summaryrefslogtreecommitdiffstats
path: root/sys/netinet/igmp.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2010-04-27 14:14:21 +0000
committerbms <bms@FreeBSD.org>2010-04-27 14:14:21 +0000
commit6def960c90c238bc5be3dd59b7704373f0b3989c (patch)
treedd1b2c610978552fabc8b25cba5810ff3dbcb9cd /sys/netinet/igmp.c
parente20b2d597f181152ff9b2de6a030674bf89a65e0 (diff)
downloadFreeBSD-src-6def960c90c238bc5be3dd59b7704373f0b3989c.zip
FreeBSD-src-6def960c90c238bc5be3dd59b7704373f0b3989c.tar.gz
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
Diffstat (limited to 'sys/netinet/igmp.c')
-rw-r--r--sys/netinet/igmp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index f9f6381..d4c8e99 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -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) {
OpenPOWER on IntegriCloud