summaryrefslogtreecommitdiff
path: root/meta-google
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2022-05-20 20:40:48 +0300
committerNan Zhou <nanzhoumails@gmail.com>2022-05-27 02:03:31 +0300
commit06ff30465ea0d4234c3bd46952723d2c6e2c5510 (patch)
treed4a8cb10c149127ae5f7777a6d9403ead687286e /meta-google
parent5fd67a26e481e06875d6bc2cde2f1a6d35577d7b (diff)
downloadopenbmc-06ff30465ea0d4234c3bd46952723d2c6e2c5510.tar.xz
meta-google: gbmc-bridge: Fix gw src routes
Only clear the route from the list if the change command succeeds. If we always clear it, we sometimes race with addresses coming and going. When this happens, we don't ever update the source route because the route is gone from the table when the address gets re-added. Change-Id: I1d8658d8f0e23d74a2bdaf96cab3e399abe2b53e Signed-off-by: William A. Kennington III <wak@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 9e01d4a6f9..4bd3828213 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
@@ -55,8 +55,8 @@ gbmc_br_gw_src_update() {
for route in "${!gbmc_br_gw_src_routes[@]}"; do
[[ "$route" != *" src $gbmc_br_gw_src_ip "* ]] || continue
echo "gBMC Bridge Updating GW source [$gbmc_br_gw_src_ip]: $route" >&2
- ip route change $route src "$gbmc_br_gw_src_ip"
- unset 'gbmc_br_gw_src_routes[$route]'
+ ip route change $route src "$gbmc_br_gw_src_ip" && \
+ unset 'gbmc_br_gw_src_routes[$route]'
done
}