Deleted Added
full compact
63c63
< __FBSDID("$FreeBSD: head/sys/netinet6/raw_ip6.c 190964 2009-04-12 13:22:33Z rwatson $");
---
> __FBSDID("$FreeBSD: head/sys/netinet6/raw_ip6.c 191672 2009-04-29 19:19:13Z bms $");
131c131,132
< * Hooks for multicast forwarding.
---
> * Hooks for multicast routing. They all default to NULL, so leave them not
> * initialized and rely on BSS being set to 0.
133c134,144
< struct socket *ip6_mrouter = NULL;
---
>
> /*
> * The socket used to communicate with the multicast routing daemon.
> */
> #ifdef VIMAGE_GLOBALS
> struct socket *ip6_mrouter;
> #endif
>
> /*
> * The various mrouter functions.
> */
151a163
> struct ifnet *ifp;
168a181,182
> ifp = m->m_pkthdr.rcvif;
>
183,185c197,207
< if (prison_check_ip6(in6p->inp_cred, &ip6->ip6_dst) != 0)
< continue;
< INP_RLOCK(in6p);
---
> if (jailed(in6p->inp_cred)) {
> /*
> * Allow raw socket in jail to receive multicast;
> * assume process had PRIV_NETINET_RAW at attach,
> * and fall through into normal filter path if so.
> */
> if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
> prison_check_ip6(in6p->inp_cred,
> &ip6->ip6_dst) != 0)
> continue;
> }
194a217,241
> INP_RLOCK(in6p);
> /*
> * If this raw socket has multicast state, and we
> * have received a multicast, check if this socket
> * should receive it, as multicast filtering is now
> * the responsibility of the transport layer.
> */
> if (in6p->in6p_moptions &&
> IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) {
> struct sockaddr_in6 mcaddr;
> 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 = im6o_mc_filter(in6p->in6p_moptions, ifp,
> (struct sockaddr *)&mcaddr,
> (struct sockaddr *)&fromsa);
> if (blocked != MCAST_PASS) {
> IP6STAT_INC(ip6s_notmember);
> continue;
> }
> }
607c654
< INIT_VNET_INET(so->so_vnet);
---
> INIT_VNET_INET6(so->so_vnet);
613c660
< if (so == ip6_mrouter && ip6_mrouter_done)
---
> if (so == V_ip6_mrouter && ip6_mrouter_done)