summaryrefslogtreecommitdiffstats
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1998-12-12 21:45:49 +0000
committerdillon <dillon@FreeBSD.org>1998-12-12 21:45:49 +0000
commit21b42c731e9d4dd0805ce9d50ac827a8ae7efe25 (patch)
tree6bfd629c156a29420a22ebfb2f657cbf1de57564 /sys/netinet/igmp.c
parentb9c991f4868ca0e7c01e203ee7261d0064d5d013 (diff)
downloadFreeBSD-src-21b42c731e9d4dd0805ce9d50ac827a8ae7efe25.zip
FreeBSD-src-21b42c731e9d4dd0805ce9d50ac827a8ae7efe25.tar.gz
PR: kern/8990
If timer calculation results in degenerate value (0), force it to 1 to avoid divide-by-zero panic later on in calls to IGMP_RANDOM_DELAY(). I considered simply adding 1 to the timer calculation, but was unsure if the calculation was part of the IGMP standard or not so did not want to mess with it for all cases.
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index 8a4bd85..713be24 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)igmp.c 8.1 (Berkeley) 7/19/93
- * $Id: igmp.c,v 1.24 1997/10/11 18:31:31 phk Exp $
+ * $Id: igmp.c,v 1.25 1997/10/12 20:25:21 phk Exp $
*/
/*
@@ -198,6 +198,8 @@ igmp_input(m, iphlen)
ip = mtod(m, struct ip *);
timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
+ if (timer == 0)
+ timer = 1;
rti = find_rti(ifp);
/*
OpenPOWER on IntegriCloud