Do not pass ifname for bonding devices (bsc#995812)

Patch-By: Thomas Renninger <trenn@suse.de>
master
Daniel Molkentin 2017-03-02 16:52:45 +01:00
parent 611b8ae0d7
commit 51f4ab300d
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,10 @@ cmdline() {
nfs_address=${lookup##* }
fi
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
if [ -e /sys/class/net/$ifname/address ] ; then
if [ -d /sys/class/net/$ifname/bonding ]; then
dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
return
elif [ -e /sys/class/net/$ifname/address ] ; then
ifmac=$(cat /sys/class/net/$ifname/address)
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
fi