Bug 110427 - /sbin/ifdown don't skip MAC address check if MACADDR was set and HWADDR not removed
/sbin/ifdown don't skip MAC address check if MACADDR was set and HWADDR not r...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-19 10:23 EST by Peter Bieringer
Modified: 2014-03-16 22:40 EDT (History)
1 user (show)

See Also:
Fixed In Version: 7.47-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-03-16 21:43:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Peter Bieringer 2003-11-19 10:23:41 EST
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 12:20:23 EST
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 12:29:29 EST
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-16 21:43:02 EST
Added in 7.47-1.

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