Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6_ifattach.c
Show First 20 Lines • Show All 840 Lines • ▼ Show 20 Lines | in6_tmpaddrtimer(void *arg) | ||||
} | } | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
} | } | ||||
static void | static void | ||||
in6_purgemaddrs(struct ifnet *ifp) | in6_purgemaddrs(struct ifnet *ifp) | ||||
{ | { | ||||
LIST_HEAD(,in6_multi) purgeinms; | struct in6_multi_head purgeinms; | ||||
struct in6_multi *inm, *tinm; | struct in6_multi *inm; | ||||
struct ifmultiaddr *ifma; | struct ifmultiaddr *ifma; | ||||
LIST_INIT(&purgeinms); | SLIST_INIT(&purgeinms); | ||||
IN6_MULTI_LOCK(); | IN6_MULTI_LOCK(); | ||||
IN6_MULTI_LIST_LOCK(); | |||||
/* | /* | ||||
* Extract list of in6_multi associated with the detaching ifp | * Extract list of in6_multi associated with the detaching ifp | ||||
* which the PF_INET6 layer is about to release. | * which the PF_INET6 layer is about to release. | ||||
* We need to do this as IF_ADDR_LOCK() may be re-acquired | * We need to do this as IF_ADDR_LOCK() may be re-acquired | ||||
* by code further down. | * by code further down. | ||||
*/ | */ | ||||
IF_ADDR_RLOCK(ifp); | IF_ADDR_RLOCK(ifp); | ||||
TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { | ||||
if (ifma->ifma_addr->sa_family != AF_INET6 || | if (ifma->ifma_addr->sa_family != AF_INET6 || | ||||
ifma->ifma_protospec == NULL) | ifma->ifma_protospec == NULL) | ||||
continue; | continue; | ||||
inm = (struct in6_multi *)ifma->ifma_protospec; | inm = (struct in6_multi *)ifma->ifma_protospec; | ||||
LIST_INSERT_HEAD(&purgeinms, inm, in6m_entry); | in6m_rele_locked(&purgeinms, inm); | ||||
} | } | ||||
IF_ADDR_RUNLOCK(ifp); | IF_ADDR_RUNLOCK(ifp); | ||||
LIST_FOREACH_SAFE(inm, &purgeinms, in6m_entry, tinm) { | |||||
LIST_REMOVE(inm, in6m_entry); | |||||
in6m_release_locked(inm); | |||||
} | |||||
mld_ifdetach(ifp); | mld_ifdetach(ifp); | ||||
IN6_MULTI_LIST_UNLOCK(); | |||||
IN6_MULTI_UNLOCK(); | IN6_MULTI_UNLOCK(); | ||||
in6m_release_list_deferred(&purgeinms); | |||||
} | } | ||||
void | void | ||||
in6_ifattach_destroy(void) | in6_ifattach_destroy(void) | ||||
{ | { | ||||
callout_drain(&V_in6_tmpaddrtimer_ch); | callout_drain(&V_in6_tmpaddrtimer_ch); | ||||
} | } | ||||
Show All 19 Lines |