Bug 110427 - /sbin/ifdown don't skip MAC address check if MACADDR was set and HWADDR not removed
Summary: /sbin/ifdown don't skip MAC address check if MACADDR was set and HWADDR not r...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 1
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-11-19 15:23 UTC by Peter Bieringer
Modified: 2014-03-17 02:40 UTC (History)
1 user (show)

Fixed In Version: 7.47-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-03-17 02:43:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Peter Bieringer 2003-11-19 15:23:41 UTC
Description of problem:
Per interface config parameter MACADDR is supported by /sbin/ifup (and
proper handled), but fyi not documented in sysconfig.txt.

Anyway, if set and parameter HWADDR was not unset, /sbin/ifdown
doesn't work anymore, reports a indeed wrong MAC address.

Version-Release number of selected component (if applicable):
initscripts-7.42-1

How reproducible:
Always

Steps to Reproduce:
1.add e.g. MACADDR="8e:c5:bb:be:a1:60" to ifcfg-eth0
2.reboot (or restart networking)
3.try to shutdown eth0 by "ifdown eth0"
    

Actual Results:  # ifdown eth0
Device eth0 has different MAC address than expected, ignoring.


Expected Results:  Shutdown of eth0

Additional info:

Solutions:
1) extend sysconfig.txt about MACADDR and 
1a) add a comment that the autoconfigured HWADDR parameter must be unset
1b) add a check in /sbin/ifdown that if MACADDR was set, the MAC check
will be skipped like:

--- ifdown.fc1orig      2003-11-19 15:53:04.000000000 +0100
+++ ifdown.new  2003-11-19 15:53:38.000000000 +0100
@@ -58,7 +58,7 @@
 # Check to make sure the device is actually up
 check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a
"$BOOTPROTO" != "bootp" ] && [ -n "$VLAN" -a "$VLAN" != "yes" ] && exit 0

-if [ -n "${HWADDR}" ]; then
+if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then
     FOUNDMACADDR=`get_hwaddr ${REALDEVICE}`
     if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then
         NEWCONFIG=`fgrep -il "HWADDR=${HWADDR}"
/etc/sysconfig/network-scripts/ifcfg-*`

Comment 1 Bill Nottingham 2003-11-19 17:20:23 UTC
Yeah, the behavior of having *both* defined isn't really specified;
it's mostly "don't do that" at this point.

Comment 2 Peter Bieringer 2003-11-19 17:29:29 UTC
But HWADDR is added to the config now by some automagic...not seen on
RHL 7.3. So perhaps people get confused if script wouldn't do an
additional check like above or warn the user on "ifup", if both values
are set.

Comment 3 Bill Nottingham 2004-03-17 02:43:02 UTC
Added in 7.47-1.


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