Skip to content

Commit 45fc8df

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 4d59421 commit 45fc8df

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

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

+16-13
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ print_fcoe_uefi_conf() {
99
mac=$(get_fcoe_boot_mac "$1")
1010
[ -z "$mac" ] && return 1
1111
dev=$(set_ifname fcoe "$mac")
12-
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
12+
vlan=$(get_fcoe_boot_vlan "$1") || return 1
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)