summaryrefslogtreecommitdiff
path: root/meta-google/recipes-google/networking
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2021-05-10 13:15:56 +0300
committerWilliam A. Kennington III <wak@google.com>2021-05-11 23:35:56 +0300
commit8fb92589e9368cff81460e89feb9da4de1f82ab8 (patch)
treecdcae3303db1341e183cec4c2a3085795442acdf /meta-google/recipes-google/networking
parent6ca7033951727549245d10d599890a49c2ed79f6 (diff)
downloadopenbmc-8fb92589e9368cff81460e89feb9da4de1f82ab8.tar.xz
meta-google: gbmc-bridge: Use networkctl reconfigure
The other workarounds to try and restart networkd tend to result in flaky behavior. We get much more consistent and fast reconfigurations if we target the bridge directly. Change-Id: I3222eba4a2d2b71e3893f93643f412e5238ee60e Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'meta-google/recipes-google/networking')
-rw-r--r--meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh
index 69897100e..8e28d3956 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh
@@ -40,10 +40,13 @@ gbmc_br_ula_update() {
printf '%s' "$contents" >"$netfile"
done
- # We have to add the address after writing the systemd config to ensure we
- # don't race with reconfiguration and drop the address.
- if [ -n "$addr" ]; then
- ip addr replace "$addr" dev gbmcbr
+ # Ensure that systemd-networkd performs a reconfiguration as it doesn't
+ # currently check the mtime of drop-in files.
+ touch -c /lib/systemd/network/*-bmc-gbmcbr.network
+
+ if [ "$(systemctl is-active systemd-networkd)" != 'inactive' ]; then
+ networkctl reload
+ networkctl reconfigure gbmcbr
fi
}