summaryrefslogtreecommitdiffstats
path: root/zebra/irdp_main.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-06-14 16:06:01 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-06-14 17:08:58 +0200
commit6196c77a4f4facc2f6df34cdf2ce02f3d5f5083c (patch)
tree212d558b903c3294b6d51150382ba6c4da685ff4 /zebra/irdp_main.c
parentMerge pull request #712 from opensourcerouting/fix-issue-683 (diff)
downloadfrr-6196c77a4f4facc2f6df34cdf2ce02f3d5f5083c.tar.xz
frr-6196c77a4f4facc2f6df34cdf2ce02f3d5f5083c.zip
zebra: fix divide-by-zero
x % 0 = FPE 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, 2 insertions, 1 deletions
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c
index 7fa4ad4cb..8f1647c9d 100644
--- a/zebra/irdp_main.c
+++ b/zebra/irdp_main.c
@@ -234,7 +234,8 @@ int irdp_send_thread(struct thread *t_advert)
}
tmp = irdp->MaxAdvertInterval-irdp->MinAdvertInterval;
- timer = (random () % tmp ) + 1;
+ assert (tmp > 0);
+ timer = (random () % tmp) + 1;
timer = irdp->MinAdvertInterval + timer;
if(irdp->irdp_sent < MAX_INITIAL_ADVERTISEMENTS &&