summaryrefslogtreecommitdiffstats
path: root/zebra/irdp_main.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-16 18:18:54 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-06-16 18:33:46 +0200
commit11e2897282839b66f7566b056c14b2558d2df354 (patch)
treeddb01c1e715b658aadb9a838f21db4270696dcf8 /zebra/irdp_main.c
parentzebra: fix divide-by-zero (diff)
downloadfrr-11e2897282839b66f7566b056c14b2558d2df354.tar.xz
frr-11e2897282839b66f7566b056c14b2558d2df354.zip
zebra: more dbzing
Revert to the previous <= restrictions, improve error messages, fix the divide by zero. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/irdp_main.c')
-rw-r--r--zebra/irdp_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index 8f1647c9d..6965dca3e 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -234,8 +234,7 @@ int irdp_send_thread(struct thread *t_advert)
}
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
- assert (tmp > 0);
- timer = (random () % tmp) + 1;
+ timer = random () % (tmp + 1);
timer = irdp->MinAdvertInterval + timer;
if(irdp->irdp_sent < MAX_INITIAL_ADVERTISEMENTS &&