meta-google: gbmc-bridge: misc gbmc-br-dhcp-term fix

Fix the condition check logic, also update comments to match the code.

Change-Id: Ie09b70d7079cd4ae5794c3a6cdb6eb6583f2cca2
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp-term.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp-term.sh
index 0a821ea..b03fba9 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp-term.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp-term.sh
@@ -26,10 +26,10 @@
     ip="${addr%/*}"
     ip_to_bytes ip_bytes "$ip" || continue
     # Ignore ULAs and non-gBMC addresses
-    (( ip_bytes[0] & 0xfc == 0xfc || ip_bytes[8] != 0xfd )) && continue
+    (( (ip_bytes[0] & 0xfc) == 0xfc || ip_bytes[8] != 0xfd )) && continue
     # Only allow for the short, well known addresses <pfx>:fd01:: and not
     # <pfx>:fd00:83c1:292d:feef. Otherwise, powercycle may be unavailable.
-    (( ip_bytes[9] == 0 )) && continue
+    (( (ip_bytes[9] & 0x0f) == 0 )) && continue
     for i in {10..15}; do
       (( ip_bytes[i] != 0 )) && continue 2
     done
@@ -46,7 +46,7 @@
   fi
 done
 
-# We need to guarantee we wait at least 5 minutes from reachable in
+# We need to guarantee we wait at least 10 minutes from reachable in
 # case networking just came up
 wait_min=10
 echo "Network is reachable, waiting $wait_min min" >&2
@@ -60,7 +60,7 @@
     GetAll s org.freedesktop.systemd1.Unit
 }
 
-# Follow the process and make sure it idles for at least 5 minutes before
+# Follow the process and make sure it idles for at least 10 minutes before
 # shutting down. This allows for failures and retries to happen.
 while true; do
   json="$(get_dhcp_unit_json)" || exit