]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ifcfg: only bind to HWADDR, if addr_assign_type == 0
authorHarald Hoyer <harald@redhat.com>
Fri, 4 Apr 2014 10:52:39 +0000 (12:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 4 Apr 2014 10:52:39 +0000 (12:52 +0200)
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces

modules.d/40network/net-lib.sh
modules.d/45ifcfg/write-ifcfg.sh

index 5d4ae32cbb154bc1a91e40df6ebd2dd1c0b82d35..d53e1a6ea9c52651954efe20b2dfd3fe0efd6183 100755 (executable)
@@ -518,9 +518,6 @@ find_iface_with_link() {
 }
 
 is_persistent_ethernet_name() {
-    [ -f /sys/class/net/$netif/addr_assign_type ] || return 1
-    [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] || return 1
-
     case "$1" in
         # udev persistent interface names
         eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
index 2631fbe2ee4647fe23c3f161c9e1101791544a02..5dc351d584a70c2e1474576957dea86bad15f560 100755 (executable)
@@ -166,6 +166,8 @@ for netup in /tmp/net.*.did-setup ; do
             if ! print_s390 $netif; then
                 if [ -z "$macaddr" ] && \
                     ! is_persistent_ethernet_name "$netif" && \
+                    [ -f /sys/class/net/$netif/addr_assign_type ] && \
+                    [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \
                     [ -f /sys/class/net/$netif/address ]; then
                     echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
                 fi