Bug 538863 - bug in /etc/sysconfig/network-scripts/network-functions
Summary: bug in /etc/sysconfig/network-scripts/network-functions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 564505 600484
TreeView+ depends on / blocked
 
Reported: 2009-11-19 15:36 UTC by Issue Tracker
Modified: 2018-11-14 20:22 UTC (History)
5 users (show)

Fixed In Version: initscripts-8.45.32-1.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 564505 (view as bug list)
Environment:
Last Closed: 2011-01-13 23:05:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0075 0 normal SHIPPED_LIVE initscripts bug fix update 2011-01-12 17:22:01 UTC

Description Issue Tracker 2009-11-19 15:36:50 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Issue Tracker 2009-11-19 15:36:52 UTC
Event posted on 2009-11-17 16:20 GMT by james.masson


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 ;
fi


Patch:

— /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 15:36:54 UTC
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 15:44:40 UTC
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 Program Management 2010-06-04 15:59:22 UTC
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
release.

Comment 9 errata-xmlrpc 2011-01-13 23:05:39 UTC
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.

http://rhn.redhat.com/errata/RHBA-2011-0075.html


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