summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2010-05-03 09:31:51 +0000
committerbms <bms@FreeBSD.org>2010-05-03 09:31:51 +0000
commit385c840a550dc5d3cb94905f2683231fda2d34dd (patch)
treeea9de1c0ec2ce1db37fd12c5ee978b09fea1032e /sys/netinet
parenta86bec6498a2e7d61b91966904633a5bef871cf0 (diff)
downloadFreeBSD-src-385c840a550dc5d3cb94905f2683231fda2d34dd.zip
FreeBSD-src-385c840a550dc5d3cb94905f2683231fda2d34dd.tar.gz
MFC r207275:
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
Diffstat (limited to 'sys/netinet')
-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