summaryrefslogtreecommitdiffstats
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-16 01:28:29 +0000
committerdg <dg@FreeBSD.org>1995-05-16 01:28:29 +0000
commite28dccb6dfe1622995b93b62a499ad3db28d26f9 (patch)
treea532b563bf4d3d02f02a5dcd52596e5b7029a822 /sys/netinet/igmp.c
parent87a603cb4db64797ef2b3bfea6e637abf603a108 (diff)
downloadFreeBSD-src-e28dccb6dfe1622995b93b62a499ad3db28d26f9.zip
FreeBSD-src-e28dccb6dfe1622995b93b62a499ad3db28d26f9.tar.gz
These diffs modify the behaviour of multicast clients to conform with the
IGMPv2 spec. This fixes the following bugs: o ntohs() on a char provides silly results o timer needs to be scaled to units of PR_FASTHZ; this was being done inconsistenly so now it gets done when it is initialized. Reviewed by: Garrett Wollman Submitted by: Bill Fenner <fenner@parc.xerox.com>
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index bfb22ae..c864e14 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.8 1995/03/16 18:14:49 bde Exp $
+ * $Id: igmp.c,v 1.9 1995/04/26 18:10:53 pst Exp $
*/
/*
@@ -167,7 +167,7 @@ igmp_input(m, iphlen)
struct in_multistep step;
struct router_info *rti;
- static int timer; /** timer value in the igmp query header **/
+ int timer; /** timer value in the igmp query header **/
++igmpstat.igps_rcv_total;
@@ -204,7 +204,7 @@ igmp_input(m, iphlen)
m->m_len += iphlen;
ip = mtod(m, struct ip *);
- timer = ntohs(igmp->igmp_code);
+ timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE;
rti = find_rti(ifp);
switch (igmp->igmp_type) {
@@ -289,9 +289,7 @@ igmp_input(m, iphlen)
break;
case IGMP_DELAYING_MEMBER:
if (inm->inm_ifp == ifp &&
- (inm->inm_timer >
- timer * PR_FASTHZ / IGMP_TIMER_SCALE)
- &&
+ (inm->inm_timer > timer) &&
inm->inm_addr.s_addr !=
igmp_all_hosts_group) {
inm->inm_timer = IGMP_RANDOM_DELAY(timer);
@@ -327,8 +325,7 @@ igmp_input(m, iphlen)
case IGMP_DELAYING_MEMBER:
inm->inm_state = IGMP_DELAYING_MEMBER;
if (inm->inm_ifp == ifp &&
- (inm->inm_timer >
- timer * PR_FASTHZ / IGMP_TIMER_SCALE) ) {
+ (inm->inm_timer > timer) ) {
inm->inm_timer = IGMP_RANDOM_DELAY(timer);
igmp_timers_are_running = 1;
inm->inm_state = IGMP_DELAYING_MEMBER;
OpenPOWER on IntegriCloud