Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 85762 - [RFE] call nameif in need_hostname() if /etc/mactab exists
Summary: [RFE] call nameif in need_hostname() if /etc/mactab exists
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-07 06:09 UTC by Matt Domsch
Modified: 2014-03-17 02:35 UTC (History)
6 users (show)

Fixed In Version: 7.26-1
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-07-03 02:56:30 UTC


Attachments (Terms of Use)

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.


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