From 6196c77a4f4facc2f6df34cdf2ce02f3d5f5083c Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 14 Jun 2017 14:06:01 +0000 Subject: zebra: fix divide-by-zero x % 0 = FPE Signed-off-by: Quentin Young --- zebra/irdp_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'zebra/irdp_main.c') diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index 7fa4ad4cbe..8f1647c9db 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 && -- cgit v1.2.3