summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-05-10 13:14:42 +0300
committerWilliam A. Kennington III <wak@google.com>2021-05-11 23:35:55 +0300
commit6ca7033951727549245d10d599890a49c2ed79f6 (patch)
treee65400280a0941d12c72ed4a4c7d9fadbf3f1817 /meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh
parent80776788b1946fbbe0748a54b18cb1b28c03a8ad (diff)
downloadopenbmc-6ca7033951727549245d10d599890a49c2ed79f6.tar.xz
meta-google: network-sh: Convert to IP bytes
Now that we can convert to and from IP bytes, we should use them everywhere to ensure values are parsed correctly. Change-Id: I995091d1eff670db6678b4a2f4a64113e93308f7 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh')
-rw-r--r--meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh
index 185d78b81..19b8f64a1 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-nft.sh
@@ -56,10 +56,14 @@ gbmc_br_nft_hook() {
echo "gBMC Bridge NFT Invalid IP: $ip" >&2
return 1
fi
- if (( ip_bytes[9] != 0xfd )); then
+ if (( ip_bytes[8] != 0xfd )); then
return 0
fi
- pfx="$(printf '%02x%02x:%02x%02x:%02x%02x:%02x%02x:fd00::/72' "${ip_bytes[@]}")"
+ local i
+ for (( i=9; i<16; i++ )); do
+ ip_bytes[$i]=0
+ done
+ pfx="$(ip_bytes_to_str ip_bytes)/72"
if [ "$action" = "add" -a "$pfx" != "$gbmc_br_nft_pfx" ]; then
gbmc_br_nft_pfx="$pfx"
gbmc_br_nft_update