diff options
author | Harm Berntsen <harm.berntsen@nedap.com> | 2019-04-27 15:24:45 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-06-07 17:06:22 +0000 |
commit | 747dd89a1c1dd388d46fe667b1bf754d59c3738b (patch) | |
tree | a3d04931a7a9e638539ffd34c242cd9478e1a8ad /initramfs-init.in | |
parent | 29cb8111788f0c11ba90757ca477bc76a824f2ac (diff) |
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.
Diffstat (limited to 'initramfs-init.in')
-rwxr-xr-x | initramfs-init.in | 2 |
1 files changed, 1 insertions, 1 deletions
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 |