meta-google: gbmc-bridge: GW SRC latch gateway status

We don't want route changes to cause the networkd reloads for flapping
default gateway status. We can assume that once a node has a default
route outside the machine it will always be able to act as a router
until powercycle (we don't dynamically reconfigure network uplinks).

Tested: Subordinate nodes still do not become routes and nodes with
uplinks are still correctly identified as routers. Fewer reloads are
shown in the logs.

Change-Id: I170add23a6a24b3e184809ca24d8d1920b42d266
Signed-off-by: William A. Kennington III <wak@google.com>
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 1d420c1..56dd840 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
@@ -31,6 +31,11 @@
       break
     fi
   done
+  # Make becoming a router sticky, if we ever have a default route we are
+  # always treated as a router. Otherwise, we end up reloading unnecessarily
+  # a number of times. The reload causes the network configuration to be
+  # reappplied with packet drops for a short amount of time.
+  [[ -z $defgw ]] && return
   [[ $defgw == "$gbmc_br_gw_defgw" ]] && return
   gbmc_br_gw_defgw="$defgw"