diff options
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/in6.h | 20 | ||||
-rw-r--r-- | sys/netinet6/in6_ifattach.c | 32 | ||||
-rw-r--r-- | sys/netinet6/in6_pcb.c | 3 |
3 files changed, 44 insertions, 11 deletions
diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 4df2b87..380b8c3 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -467,6 +467,14 @@ struct route_in6 { * the source address. */ +/* + * The following option is private; do not use it from user applications. + * It is deliberately defined to the same value as IP_MSFILTER. + */ +#define IPV6_MSFILTER 74 /* struct __msfilterreq; + * set/get multicast source filter list. + */ + /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ @@ -487,6 +495,18 @@ struct ipv6_mreq { unsigned int ipv6mr_interface; }; +#ifdef notyet +/* + * Argument structure for IPV6_ADD_SOURCE_MEMBERSHIP, + * IPV6_DROP_SOURCE_MEMBERSHIP, IPV6_BLOCK_SOURCE, and IPV6_UNBLOCK_SOURCE. + */ +struct ipv6_mreq_source { + struct in6_addr ipv6mr_multiaddr; + struct in6_addr ipv6mr_sourceaddr; + uint32_t ipv6mr_interface; +}; +#endif + /* * IPV6_PKTINFO: Packet information(RFC2292 sec 5) */ diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index b78b5c9..e00e7fa 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -76,6 +76,7 @@ static int generate_tmp_ifid __P((u_int8_t *, const u_int8_t *, u_int8_t *)); static int get_ifid __P((struct ifnet *, struct ifnet *, struct in6_addr *)); static int in6_ifattach_linklocal __P((struct ifnet *, struct ifnet *)); static int in6_ifattach_loopback __P((struct ifnet *)); +static void in6_purgemaddrs __P((struct ifnet *)); #define EUI64_GBIT 0x01 #define EUI64_UBIT 0x02 @@ -798,18 +799,10 @@ in6_ifdetach(ifp) IFAFREE(&oia->ia_ifa); } - /* leave from all multicast groups joined */ - in6_pcbpurgeif0(&udbinfo, ifp); in6_pcbpurgeif0(&ripcbinfo, ifp); - - for (in6m = LIST_FIRST(&in6_multihead); in6m; in6m = in6m_next) { - in6m_next = LIST_NEXT(in6m, in6m_entry); - if (in6m->in6m_ifp != ifp) - continue; - in6_delmulti(in6m); - in6m = NULL; - } + /* leave from all multicast groups joined */ + in6_purgemaddrs(ifp); /* * remove neighbor management table. we call it twice just to make @@ -898,3 +891,22 @@ in6_tmpaddrtimer(ignored_arg) splx(s); } + +static void +in6_purgemaddrs(ifp) + struct ifnet *ifp; +{ + struct in6_multi *in6m; + struct in6_multi *oin6m; + +#ifdef DIAGNOSTIC + printf("%s: purging ifp %p\n", __func__, ifp); +#endif + + IFF_LOCKGIANT(ifp); + LIST_FOREACH_SAFE(in6m, &in6_multihead, in6m_entry, oin6m) { + if (in6m->in6m_ifp == ifp) + in6_delmulti(in6m); + } + IFF_UNLOCKGIANT(ifp); +} diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 5ea647e..863e53f 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -456,7 +456,8 @@ in6_pcbfree(struct inpcb *inp) /* Check and free IPv4 related resources in case of mapped addr */ if (inp->inp_options) (void)m_free(inp->inp_options); - ip_freemoptions(inp->inp_moptions); + if (inp->inp_moptions != NULL) + inp_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; INP_UNLOCK(inp); uma_zfree(ipi->ipi_zone, inp); |