summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-11-05 14:15:36 +0300
committerWilliam A. Kennington III <wak@google.com>2021-11-06 02:40:43 +0300
commit58ac4343a47e69e6c23f7f3128b6da1b9d922a91 (patch)
tree0bae6d81e7c88eee8217d04b44dece8827811a8c /meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
parentcefbd1cf61ec037f62b7f5cfe93c727ed234226a (diff)
downloadopenbmc-58ac4343a47e69e6c23f7f3128b6da1b9d922a91.tar.xz
meta-google: gbmc-bridge: Defer address reconfiguration
Reconfiguring network interfaces immediately after detecting changes may not allow them enough time to settle. Without waiting, we might pre-emptively assume the configuration is changing even though networkd is just flushing and resetting the interface with the same config. Change-Id: I6a6858578d0499305fe2a3d3592dc73533bb02f1 Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in')
-rw-r--r--meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
index ce53b8efb..5adc41328 100644
--- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-pub-addr.sh.in
@@ -16,9 +16,12 @@
gbmc_ncsi_br_pub_addr_init=
gbmc_ncsi_br_pub_addr_lastip=
+gbmc_ncsi_br_pub_addr_confip=
gbmc_ncsi_br_pub_addr_update() {
[ -n "$gbmc_ncsi_br_pub_addr_init" ] || return
+ [ "$gbmc_ncsi_br_pub_addr_confip" != "$gbmc_ncsi_br_pub_addr_lastip" ] || return
+ gbmc_ncsi_br_pub_addr_confip="$gbmc_ncsi_br_pub_addr_lastip"
printf 'gBMC Bridge Pub Addr from NCSI: %s\n' \
"${gbmc_ncsi_br_pub_addr_lastip:-(deleted)}" >&2
@@ -85,17 +88,19 @@ EOF
gbmc_ncsi_br_pub_addr_hook() {
if [ "$change" = 'init' ]; then
gbmc_ncsi_br_pub_addr_init=1
+ gbmc_ip_monitor_defer
+ elif [ "$change" = 'defer' ]; then
gbmc_ncsi_br_pub_addr_update
elif [ "$change" = 'addr' -a "$intf" = '@NCSI_IF@' ] &&
[ "$scope" = 'global' -a "$fam" = 'inet6' ] &&
[[ "$flags" != *deprecated* ]]; then
if [ "$action" = 'add' -a "$ip" != "$gbmc_ncsi_br_pub_addr_lastip" ]; then
gbmc_ncsi_br_pub_addr_lastip="$ip"
- gbmc_ncsi_br_pub_addr_update
+ gbmc_ip_monitor_defer
fi
if [ "$action" = 'del' -a "$ip" = "$gbmc_ncsi_br_pub_addr_lastip" ]; then
gbmc_ncsi_br_pub_addr_lastip=
- gbmc_ncsi_br_pub_addr_update
+ gbmc_ip_monitor_defer
fi
fi
}