meta-google: gbmc-bridge: Deprecated drop networkd reload

We can set up the neighbor proxy entries without reloading networkd,
this helps to keep the network available instead of churning through the
networkd reconfiguration.

Tested: Neighbor entries are still added as expected across multiple
NCSI style machines.

Change-Id: I86ab7fee93659833e8ab7d3e0776004ce4cf521d
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-deprecated-ips.sh.in b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-deprecated-ips.sh.in
index b392176..1e2db45 100644
--- a/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-deprecated-ips.sh.in
+++ b/meta-google/recipes-google/ncsi/files/gbmc-ncsi-br-deprecated-ips.sh.in
@@ -86,11 +86,27 @@
     fi
   done
 
-  # Ensure that systemd-networkd performs a reconfiguration as it doesn't
-  # currently check the mtime of drop-in files.
-  touch -c /etc/systemd/network/*-bmc-@NCSI_IF@.network
+  # Remove all old ncsi neighbor proxied entries, since we solely
+  # manage all of these entries and we don't want any that are stale
+  local entry
+  while read -r entry; do
+    ip -6 neigh del proxy ${entry%% *} dev @NCSI_IF@ || true
+  done < <(ip -6 neigh show proxy dev @NCSI_IF@)
 
-  if [ "$(systemctl is-active systemd-networkd)" != 'inactive' ]; then
+  local st=0
+  if [ -n "$gbmc_ncsi_br_deprecated_ips_lastip" ]; then
+    sysctl net.ipv6.conf.@NCSI_IF@.proxy_ndp=1 >/dev/null || st=$?
+    ip -6 neigh add proxy $pfx dev @NCSI_IF@ || st=$?
+    ip -6 neigh add proxy $stateless_pfx dev @NCSI_IF@ || st=$?
+    if [ -n "$host_pfx" ]; then
+      ip -6 neigh add proxy $host_pfx dev @NCSI_IF@ || st=$?
+    fi
+    if [ -n "$stateless_ip" ]; then
+      ip -6 neigh add proxy $stateless_ip dev @NCSI_IF@ || st=$?
+    fi
+  fi
+
+  if (( st != 0 )); then
     networkctl reload && networkctl reconfigure @NCSI_IF@
   fi