gbmc-ncsi-config: Fix nftables rule writing
The `pfx` variable was not correctly being initialized
Change-Id: Iafc0a2ca8dbfe943a9bc8c1649ae68fb00d267a1
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-nft.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-nft.sh.in
index 93d1a4a..d07b9e2 100644
--- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-nft.sh.in
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-nft.sh.in
@@ -35,6 +35,7 @@
fi
local ip6="$gbmc_ncsi_nft_lastip6"
+ local pfx=
if [ -n "$ip6" ]; then
contents+=" ip6 daddr $ip6/128 goto ncsi_legacy_input"$'\n'
@@ -52,7 +53,7 @@
done
if (( ${#ip_bytes[@]} != 0 )); then
ip_bytes[8]=0xfd
- local pfx="$(ip_bytes_to_str ip_bytes)"
+ pfx="$(ip_bytes_to_str ip_bytes)"
contents+=" ip6 saddr != $pfx/72 ip6 daddr"
contents+=" $pfx/72 goto ncsi_gbmc_br_pub_input"$'\n'
fi