Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/ip6_input.c
Show First 20 Lines • Show All 330 Lines • ▼ Show 20 Lines | if (ip6_protox[proto] != rip6_input) { | ||||
ip6_ctlprotox[proto] = rip6_ctlinput; | ip6_ctlprotox[proto] = rip6_ctlinput; | ||||
return (0); | return (0); | ||||
} else | } else | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
static void | static void | ||||
ip6_destroy(void *unused __unused) | ip6_shutdown(void *unused __unused) | ||||
{ | { | ||||
struct ifaddr *ifa, *nifa; | struct ifaddr *ifa, *nifa; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
/* Cleanup addresses. */ | |||||
IFNET_RLOCK(); | |||||
CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { | |||||
/* Cannot lock here - lock recursion. */ | |||||
/* IF_ADDR_LOCK(ifp); */ | |||||
CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { | |||||
if (ifa->ifa_addr->sa_family != AF_INET6) | |||||
continue; | |||||
in6_purgeaddr(ifa); | |||||
zlei: TODO: LOR panic here | |||||
} | |||||
/* IF_ADDR_UNLOCK(ifp); */ | |||||
// FIXME in6_ifdetach() or in6_ifdetach_destroy() ? | |||||
in6_ifdetach(ifp); | |||||
mld_domifdetach(ifp); | |||||
} | |||||
IFNET_RUNLOCK(); | |||||
/* Make sure any routes are gone as well. */ | |||||
rib_flush_routes_family(AF_INET6); | |||||
} | |||||
VNET_SHUTDOWN(ip6_shutdown, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip6_shutdown, NULL); | |||||
static void | |||||
ip6_destroy(void *unused __unused) | |||||
{ | |||||
int error; | int error; | ||||
#ifdef RSS | #ifdef RSS | ||||
netisr_unregister_vnet(&ip6_direct_nh); | netisr_unregister_vnet(&ip6_direct_nh); | ||||
#endif | #endif | ||||
netisr_unregister_vnet(&ip6_nh); | netisr_unregister_vnet(&ip6_nh); | ||||
pfil_head_unregister(V_inet6_pfil_head); | pfil_head_unregister(V_inet6_pfil_head); | ||||
error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET6]); | error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET6]); | ||||
if (error != 0) { | if (error != 0) { | ||||
printf("%s: WARNING: unable to deregister input helper hook " | printf("%s: WARNING: unable to deregister input helper hook " | ||||
"type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET6: " | "type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET6: " | ||||
"error %d returned\n", __func__, error); | "error %d returned\n", __func__, error); | ||||
} | } | ||||
error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET6]); | error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET6]); | ||||
if (error != 0) { | if (error != 0) { | ||||
printf("%s: WARNING: unable to deregister output helper hook " | printf("%s: WARNING: unable to deregister output helper hook " | ||||
"type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: " | "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: " | ||||
"error %d returned\n", __func__, error); | "error %d returned\n", __func__, error); | ||||
} | } | ||||
/* Cleanup addresses. */ | |||||
IFNET_RLOCK(); | |||||
CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { | |||||
/* Cannot lock here - lock recursion. */ | |||||
/* IF_ADDR_LOCK(ifp); */ | |||||
CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { | |||||
if (ifa->ifa_addr->sa_family != AF_INET6) | |||||
continue; | |||||
in6_purgeaddr(ifa); | |||||
} | |||||
/* IF_ADDR_UNLOCK(ifp); */ | |||||
in6_ifdetach_destroy(ifp); | |||||
mld_domifdetach(ifp); | |||||
} | |||||
IFNET_RUNLOCK(); | |||||
/* Make sure any routes are gone as well. */ | |||||
rib_flush_routes_family(AF_INET6); | |||||
frag6_destroy(); | frag6_destroy(); | ||||
nd6_destroy(); | nd6_destroy(); | ||||
in6_ifattach_destroy(); | in6_ifattach_destroy(); | ||||
hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); | hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,320 Lines • Show Last 20 Lines |
TODO: LOR panic here