diff options
Diffstat (limited to 'src/router.c')
-rw-r--r-- | src/router.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/router.c b/src/router.c index dd3f09c..ffafb94 100644 --- a/src/router.c +++ b/src/router.c @@ -233,7 +233,8 @@ static int calc_adv_interval(struct interface *iface, uint32_t minvalid, minival = (*maxival >= 9 ? *maxival/3 : *maxival); odhcpd_urandom(&msecs, sizeof(msecs)); - msecs = (labs(msecs) % ((*maxival - minival)*1000)) + minival*1000; + msecs = (labs(msecs) % ((*maxival != minival) ? (*maxival - minival)*1000 : 500)) + + minival*1000; return msecs; } |