Bug 538863 - bug in /etc/sysconfig/network-scripts/network-functions
bug in /etc/sysconfig/network-scripts/network-functions
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: initscripts Maintenance Team
Depends On:
Blocks: 564505 600484
  Show dependency treegraph
Reported: 2009-11-19 10:36 EST by Issue Tracker
Modified: 2011-01-13 18:05 EST (History)
5 users (show)

See Also:
Fixed In Version: initscripts-8.45.32-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 564505 (view as bug list)
Last Closed: 2011-01-13 18:05:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Issue Tracker 2009-11-19 10:36:50 EST
Escalated to Bugzilla from IssueTracker
Comment 1 Issue Tracker 2009-11-19 10:36:52 EST
Event posted on 2009-11-17 16:20 GMT by james.masson@tradefair.com

There is a bug in the RHEL 5.4 networking scripts where by a network bond will not be created if a bond that includes the new bond name already exists. For example, you will not be able to create bond20 if bond200 exists.

Example, creating bond200 before bond20:

[root@localhost ~]# ifup bond200
[root@localhost ~]# ifup bond20
Error for wireless request "Set Encode" (8B2A) :
    SET failed on device bond20 ; Invalid argument.
SIOCGIFFLAGS: No such device

Creating bond20 before bond200:

[root@localhost ~]# ifup bond20
[root@localhost ~]# ifup bond200

This is caused by /etc/sysconfig/network-scripts/network-functions:217

215: is_available ()
216: {
217:    LC_ALL= LANG= ip -o link | grep -q $1
218:     [ "$?" = "1" ] || return 0

If bond200 exists, this will be matched by grep for bond20 and the bond will not be created.

A more accurate way of testing for the existance of the bond would be to:

if [ -d "/sys/class/net/$1" ];
    then return 0 ;


— /etc/sysconfig/network-scripts/network-functions	2007-06-22 21:14:42.000000000 +0000
+++ ./network-functions	2009-11-17 14:37:26.000000000 +0000
@@ -214,8 +214,9 @@
 # Sets $alias to the device module if $? != 0
 is_available ()
-    LC_ALL= LANG= ip -o link | grep -q $1
-    [ “$?” = “1″ ] || return 0
+    if [ -d “/sys/class/net/$1″ ]; then
+        return 0 ;
+    fi

     alias=$(modprobe -c | awk \
 ‘BEGIN { alias = “”; }
This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 366695
Comment 2 Issue Tracker 2009-11-19 10:36:54 EST
Event posted on 2009-11-19 15:34 GMT by mpoole

A quick review of the network-functions script suggests that are at least a
couple of extra places where this issue could occur.

I will escalate this to BZ for engineering review since the potential for
further unintended consequences after change is high.

This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 366695
Comment 3 Martin Poole 2009-11-19 10:44:40 EST
In addition to the specific line mentioned there are at least two other unbound search attempt in the network-functions script.

The first is at the end of the same is_available script. Given the identical nature of the code whichever is the correct fix is probably a candidate for a sub-function.

The other candidate I can see would be the use of the ifconfig -a | grep in the check_device_down () function since this could also erroneously trigger with a short search matching a long name. A related thought here being why not call the ifconfig with the device parameter directly rather than taking all the output ?
Comment 5 RHEL Product and Program Management 2010-06-04 11:59:22 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 9 errata-xmlrpc 2011-01-13 18:05:39 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.