diff options
author | bms <bms@FreeBSD.org> | 2009-11-20 11:58:04 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2009-11-20 11:58:04 +0000 |
commit | 4e48239cf8310f44641f3f35a5320f3debc27402 (patch) | |
tree | 3d4cd7c43fbe84c0868350ca855a620d4561f0bd /sys/netinet6/raw_ip6.c | |
parent | 3037a3983ee772024e471421609bff9b9caaa57a (diff) | |
download | FreeBSD-src-4e48239cf8310f44641f3f35a5320f3debc27402.zip FreeBSD-src-4e48239cf8310f44641f3f35a5320f3debc27402.tar.gz |
MFC r199518:
Adapt the fix for IGMPv2 in r199287 for the IPv6 stack.
Only multicast routing is affected by the issue.
Diffstat (limited to 'sys/netinet6/raw_ip6.c')
-rw-r--r-- | sys/netinet6/raw_ip6.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 108742d..335eff5 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -213,17 +213,39 @@ rip6_input(struct mbuf **mp, int *offp, int proto) */ if (in6p->in6p_moptions && IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - struct sockaddr_in6 mcaddr; + /* + * If the incoming datagram is for MLD, allow it + * through unconditionally to the raw socket. + * + * Use the M_RTALERT_MLD flag to check for MLD + * traffic without having to inspect the mbuf chain + * more deeply, as all MLDv1/v2 host messages MUST + * contain the Router Alert option. + * + * In the case of MLDv1, we may not have explicitly + * joined the group, and may have set IFF_ALLMULTI + * on the interface. im6o_mc_filter() may discard + * control traffic we actually need to see. + * + * Userland multicast routing daemons should continue + * filter the control traffic appropriately. + */ int blocked; - bzero(&mcaddr, sizeof(struct sockaddr_in6)); - mcaddr.sin6_len = sizeof(struct sockaddr_in6); - mcaddr.sin6_family = AF_INET6; - mcaddr.sin6_addr = ip6->ip6_dst; + blocked = MCAST_PASS; + if ((m->m_flags & M_RTALERT_MLD) == 0) { + struct sockaddr_in6 mcaddr; - blocked = im6o_mc_filter(in6p->in6p_moptions, ifp, - (struct sockaddr *)&mcaddr, - (struct sockaddr *)&fromsa); + bzero(&mcaddr, sizeof(struct sockaddr_in6)); + mcaddr.sin6_len = sizeof(struct sockaddr_in6); + mcaddr.sin6_family = AF_INET6; + mcaddr.sin6_addr = ip6->ip6_dst; + + blocked = im6o_mc_filter(in6p->in6p_moptions, + ifp, + (struct sockaddr *)&mcaddr, + (struct sockaddr *)&fromsa); + } if (blocked != MCAST_PASS) { IP6STAT_INC(ip6s_notmember); continue; |