summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorYuxiao Zhang <yuxiaozhang@google.com>2024-02-21 23:14:12 +0300
committerYuxiao Zhang <yuxiaozhang@google.com>2024-02-22 00:01:39 +0300
commit4b1216dac3d5b3fde5241ed6161e8ec1e5bfc19e (patch)
treed272862955ce0f4ca466954a11d95602caba91ab /meta-google
parentcb5aa61fe6dc534cf4cd0902fae3d67d80dbd39e (diff)
downloadopenbmc-4b1216dac3d5b3fde5241ed6161e8ec1e5bfc19e.tar.xz
meta-google: gbmc-bridge: fix ip check
We want to priortize stateful ip, the current code is buggy and ip was randomly selected between stateful and stateless. Tested: locally verified that the ip check logic is expected. gbmc-ip-monitor.sh[9646]: stateful 2607:f8b0:809e:446:fd02:: gbmc-ip-monitor.sh[9646]: gBMC Bridge Updating GW source [2607:f8b0:809e:446:fd02::]: default via fe80::2695:2fff:fec2:d3c dev gbmcbr proto ra metric 1056 pref medium gbmc-ip-monitor.sh[9646]: 2607:f8b0:809e:446:fd00:5c33:7bbb:394a and 2607:f8b0:809e:446:fd02:: gbmc-ip-monitor.sh[9646]: stateful exist 2607:f8b0:809e:446:fd02:: Change-Id: I9ae8f675e5dc50d62941fb177966d4c5062c370e Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
Diffstat (limited to 'meta-google')
-rw-r--r--meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-gw-src.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-gw-src.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-gw-src.sh
index 693c728f43..dbf215794a 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-gw-src.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-gw-src.sh
@@ -94,10 +94,10 @@ gbmc_br_gw_src_hook() {
return 1
fi
# Ignore ULAs and non-gBMC addresses
- if (( ip_bytes[0] & 0xfe == 0xfc || ip_bytes[8] != 0xfd )); then
+ if (( (ip_bytes[0] & 0xfe) == 0xfc || ip_bytes[8] != 0xfd )); then
return 0
fi
- if (( ip_bytes[9] & 0x0f != 0 )); then
+ if (( (ip_bytes[9] & 0x0f) != 0 )); then
local -n gbmc_br_gw_src_ip=gbmc_br_gw_src_ip_stateful
else
local -n gbmc_br_gw_src_ip=gbmc_br_gw_src_ip_stateless