Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 85762

Summary: [RFE] call nameif in need_hostname() if /etc/mactab exists
Product: [Retired] Red Hat Linux Reporter: Matt Domsch <matt_domsch>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: aleksey, dale_kaisner, john_hull, mitr, rvokal, tao
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 7.26-1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-03 02:56:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matt Domsch 2003-03-07 06:09:56 UTC
Description of problem:
It would be nice to be able to use named ethernet interfaces during the bootup
process.  Currently, nameif isn't called to name interfaces after their modules
are loaded.

This patch calls nameif after loading each network module.

--- network-functions.~2~       2003-03-06 10:45:59.000000000 -0600
+++ network-functions   2003-03-06 10:48:08.000000000 -0600
@@ -93,7 +93,8 @@
         return 2
     fi
     modprobe $1 > /dev/null 2>&1 || return 1
+    [ -f /etc/mactab ] && /sbin/nameif
     LC_ALL= LANG= ip -o link | grep -q $1
     return $?
 }

Version-Release number of selected component (if applicable):
initscripts-7.10-1 or earlier

Comment 1 Bill Nottingham 2003-03-07 20:24:50 UTC
Hm, if we do this, will have to look into how to avoid the 'wireless' problem.


Comment 2 James Pattie 2003-05-06 17:11:17 UTC
We have an alternative to the above patch wherein we call nameif on an
individual basis instead of N times for N interfaces.  The interfaces that do
not exist yet will blow errors when done with the above method.

We had the same problem and I made a quick page discussing it at
www.pcxperience.org/nameif/

This patch is against RH 9.0 but can be easily changed for other versions.

/etc/sysconfig/network-scripts/network-functions

--- network-functions.orig      2003-02-10 20:34:18.000000000 -0600
+++ network-functions   2003-05-06 11:20:26.000000000 -0500
@@ -93,6 +93,9 @@
         return 2
     fi
     modprobe $1 > /dev/null 2>&1 || return 1
+    if [ -n "${HWADDR}" ]; then
+      /sbin/nameif "$1" "${HWADDR}"
+    fi
     LC_ALL= LANG= ip -o link | grep -q $1
     return $?
 }



to make sure that HWADDR is available we also patched /etc/init.d/network

--- network.orig        2003-02-03 20:19:20.000000000 -0600
+++ network     2003-05-06 11:18:03.000000000 -0500
@@ -107,6 +107,7 @@
                        continue
                fi
                if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >
/dev/null ; then
+                       eval $(fgrep "HWADDR" ifcfg-$i)
                        # this loads the module, to preserve ordering
                        is_available $i
                        continue



OPTIONALLY you can take out the other spot where this was trying to be done in
/sbin/ifup

--- ifup.orig   2003-03-12 19:16:46.000000000 -0600
+++ ifup        2003-05-06 11:18:48.000000000 -0500
@@ -152,16 +152,6 @@
          exit 0
       fi
 }
-if [ -n "${HWADDR}" ]; then
-    FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \
-       sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'`
-    if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
-        /sbin/nameif "${REALDEVICE}" "${HWADDR}" || {
-          echo $"Device ${DEVICE} has different MAC address than expected,
ignoring."
-          exit 1
-       }
-    fi
-fi

 # is the device wireless? If so, configure wireless device specifics
 is_wireless_device ${DEVICE} && . ./ifup-wireless


Comment 3 acount closed by user 2003-05-23 12:38:35 UTC
which is the bug state?
initscripts-7.22-1 doesn't has any change

Comment 4 Bill Nottingham 2003-05-23 13:59:08 UTC
There are various other places that don't really handle arbitrary device names
correctly that need fixed first.

Comment 5 Bill Nottingham 2003-07-03 02:56:30 UTC
Various things added in 7.26-1. Let's see what breaks.

Comment 6 Aleksey Nogin 2003-07-23 18:47:13 UTC
I filed bug 100622 for interfaces that are brought up by hotplug.