ifcfg: only bind to HWADDR, if addr_assign_type == 0

/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces
master
Harald Hoyer 2014-04-04 12:52:39 +02:00
parent fb0e5184a6
commit 2e094b20a6
2 changed files with 2 additions and 3 deletions

View File

@ -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]*)

View File

@ -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