ref: 747dd89a1c1dd388d46fe667b1bf754d59c3738b
parent: 29cb8111788f0c11ba90757ca477bc76a824f2ac
author: Harm Berntsen <harm.berntsen@nedap.com>
date: Sat Apr 27 10:24:45 CDT 2019
Add missing return to ip_choose_if Right now, when $KOPT_BOOTIF is specified, it can echo a device related to that option and still continue with the loop that checks the operstate. Due to this, it can echo two network interfaces. This commit fixes that so it will only return a single network interface.
--- a/initramfs-init.in
+++ b/initramfs-init.in
@@ -128,7 +128,7 @@
mac=$(printf "%s\n" "$KOPT_BOOTIF"|sed 's/^01-//;s/-/:/g')
dev=$(grep -l $mac /sys/class/net/*/address|head -n 1)
dev=${dev%/*}
- [ -n "$dev" ] && echo "${dev##*/}"
+ [ -n "$dev" ] && echo "${dev##*/}" && return
fi
for x in /sys/class/net/eth*; do
if grep -iq up $x/operstate;then