--- /usr/src/sys/netinet/igmp.c.orig Wed Dec 22 11:13:17 1999 +++ /usr/src/sys/netinet/igmp.c Mon Apr 30 16:31:27 2001 @@ -45,10 +45,18 @@ * Modified by Rosen Sharma, Stanford, Aug 1994. * Modified by Bill Fenner, Xerox PARC, Feb 1995. * Modified to fully comply to IGMPv2 by Bill Fenner, Oct 1995. * * MULTICAST Revision: 3.5.1.4 + * + * 04/30/2001: New sysctl variable "net.inet.igmp.high_bandwidth" added. + * + * When "high bandwidth" is enabled, several behaviors change: + * 1. IGMP state is ALWAYS IGMPv2, even if v1 routers exist. + * 2. When joining a group, a report is ALWAYS sent. + * 3. When leaving a group, a leave is ALWAYS sent. + * 4. When a query is received, a report is sent IMMEDIATELY. */ #include #include #include @@ -77,10 +85,14 @@ static struct igmpstat igmpstat; SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RD, &igmpstat, igmpstat, ""); +static int igmp_highbw = 0; +SYSCTL_INT(_net_inet_igmp, OID_AUTO, high_bandwidth, CTLFLAG_RW, + &igmp_highbw, 0, "High BW IGMP behavior"); + static int igmp_timers_are_running; static u_long igmp_all_hosts_group; static u_long igmp_all_rtrs_group; static struct mbuf *router_alert; static struct router_info *Head; @@ -197,11 +209,11 @@ m->m_data -= iphlen; m->m_len += iphlen; ip = mtod(m, struct ip *); timer = igmp->igmp_code * PR_FASTHZ / IGMP_TIMER_SCALE; - if (timer == 0) + if (timer == 0 || igmp_highbw) timer = 1; rti = find_rti(ifp); /* * In the IGMPv2 specification, there are 3 states and a flag. @@ -220,11 +232,11 @@ ++igmpstat.igps_rcv_queries; if (ifp->if_flags & IFF_LOOPBACK) break; - if (igmp->igmp_code == 0) { + if (igmp->igmp_code == 0 && igmp_highbw == 0) { /* * Old router. Remember that the querier on this * interface is old, and set the timer to the * value in RFC 1112. */ @@ -287,10 +299,14 @@ * For fast leave to work, we have to know that we are the * last person to send a report for this group. Reports * can potentially get looped back if we are a multicast * router, so discard reports sourced by me. */ + + if(igmp_highbw) /* if high-bandwidth, we ALWAYS */ + break; /* send reports and leaves */ + IFP_TO_IA(ifp, ia); if (ia && ip->ip_src.s_addr == IA_SIN(ia)->sin_addr.s_addr) break; ++igmpstat.igps_rcv_reports;