From 747dd89a1c1dd388d46fe667b1bf754d59c3738b Mon Sep 17 00:00:00 2001 From: Harm Berntsen Date: Sat, 27 Apr 2019 15:24:45 +0200 Subject: 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. --- initramfs-init.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'initramfs-init.in') diff --git a/initramfs-init.in b/initramfs-init.in index 4760714..4f96b7c 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -128,7 +128,7 @@ ip_choose_if() { 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 -- cgit v1.2.3