From 8fb92589e9368cff81460e89feb9da4de1f82ab8 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 10 May 2021 03:15:56 -0700 Subject: 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 --- .../recipes-google/networking/gbmc-bridge/gbmc-br-ula.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'meta-google/recipes-google/networking') 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 } -- cgit v1.2.3