ncsid: fix default wait time
The default wait time needs to shift with current timestamp, otherwise
the script will keep looping with 0 intervals and 0 wait time in RA, if
the initial loop does not capture any RA data.
Tested: bring down the interface to simulate the nic not ready, start
this script and verified that it loops every 10s. Then bring up the
interface, and see the route is setup with no issue
Change-Id: I4189f39c1e9efc0dd9dbbdf1116c505b755a6982
Signed-off-by: Yuxiao Zhang <yuxiaozhang@google.com>
diff --git a/subprojects/ncsid/src/update_ra_gw.sh b/subprojects/ncsid/src/update_ra_gw.sh
index faf7a15..b11dbb1 100644
--- a/subprojects/ncsid/src/update_ra_gw.sh
+++ b/subprojects/ncsid/src/update_ra_gw.sh
@@ -77,7 +77,7 @@
rtrs=()
while true; do
data=(${rtrs["${old_rtr}"]-})
- curr_dl="${data[1]-$min_w}"
+ curr_dl="${data[1]-$(( min_w + SECONDS ))}"
args=(-m "$NCSI_IF" -w $(( (curr_dl - SECONDS) * 1000 )))
if (( retries > 0 )); then
args+=(-r "$retries")