Fix a regression where DVMRP diagnostic traffic, such as that used

by mrinfo and mtrace, was dropped by the IGMP TTL check. IGMP control
traffic must always have a TTL of 1.

Submitted by:	Matthew Luckie
MFC after:	3 days
This commit is contained in:
Bruce M Simpson 2010-04-27 14:14:21 +00:00
parent 8bac98182a
commit fd963b9929
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207275

View File

@ -1468,12 +1468,6 @@ igmp_input(struct mbuf *m, int off)
}
ip = mtod(m, struct ip *);
if (ip->ip_ttl != 1) {
IGMPSTAT_INC(igps_rcv_badttl);
m_freem(m);
return;
}
/*
* Validate checksum.
*/
@ -1488,6 +1482,17 @@ igmp_input(struct mbuf *m, int off)
m->m_data -= iphlen;
m->m_len += iphlen;
/*
* IGMP control traffic is link-scope, and must have a TTL of 1.
* DVMRP traffic (e.g. mrinfo, mtrace) is an exception;
* probe packets may come from beyond the LAN.
*/
if (igmp->igmp_type != IGMP_DVMRP && ip->ip_ttl != 1) {
IGMPSTAT_INC(igps_rcv_badttl);
m_freem(m);
return;
}
switch (igmp->igmp_type) {
case IGMP_HOST_MEMBERSHIP_QUERY:
if (igmplen == IGMP_MINLEN) {