Skip to content

Commit c22941d

Browse files
committed
fix(fcoe-uefi): exit early on empty vlan
Exit early in case get_fcoe_boot_vlan exits with error or just an empty string, instead of producing invalid config entry.
1 parent aa20bbb commit c22941d

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

modules.d/95fcoe-uefi/parse-uefifcoe.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ print_fcoe_uefi_conf() {
1010
[ -z "$mac" ] && return 1
1111
dev=$(set_ifname fcoe "$mac")
1212
vlan=$(get_fcoe_boot_vlan "$1")
13-
if [ "$vlan" -ne "0" ]; then
14-
case "$vlan" in
15-
[0-9]*)
16-
printf "%s\n" "vlan=$dev.$vlan:$dev"
17-
dev="$dev.$vlan"
18-
;;
19-
*)
20-
printf "%s\n" "vlan=$vlan:$dev"
21-
dev="$vlan"
22-
;;
23-
esac
24-
fi
13+
case "$vlan" in
14+
"0") ;;
15+
16+
'')
17+
return 1
18+
;;
19+
[0-9]*)
20+
printf "%s\n" "vlan=$dev.$vlan:$dev"
21+
dev="$dev.$vlan"
22+
;;
23+
*)
24+
printf "%s\n" "vlan=$vlan:$dev"
25+
dev="$vlan"
26+
;;
27+
esac
2528
# fcoe=eth0:nodcb
2629
printf "fcoe=%s\n" "$dev:nodcb"
2730
return 0

0 commit comments

Comments
 (0)