diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-14 16:06:01 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-06-14 17:08:58 +0200 |
commit | 6196c77a4f4facc2f6df34cdf2ce02f3d5f5083c (patch) | |
tree | 212d558b903c3294b6d51150382ba6c4da685ff4 /zebra/irdp_main.c | |
parent | Merge pull request #712 from opensourcerouting/fix-issue-683 (diff) | |
download | frr-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.c | 3 |
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 && |