Skip to content

Commit 8135df0

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 8135df0

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

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

+16-12
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ 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+
14+
case "$vlan" in
15+
"0")
16+
;;
17+
'')
18+
return 1
19+
;;
20+
[0-9]*)
21+
printf "%s\n" "vlan=$dev.$vlan:$dev"
22+
dev="$dev.$vlan"
23+
;;
24+
*)
25+
printf "%s\n" "vlan=$vlan:$dev"
26+
dev="$vlan"
27+
;;
28+
esac
2529
# fcoe=eth0:nodcb
2630
printf "fcoe=%s\n" "$dev:nodcb"
2731
return 0

0 commit comments

Comments
 (0)