| 348 | |
| 349 | #ifdef VIMAGE |
| 350 | static void |
| 351 | ip6_destroy(void *unused __unused) |
| 352 | { |
| 353 | struct ifaddr *ifa, *nifa; |
| 354 | struct ifnet *ifp; |
| 355 | int error; |
| 356 | |
| 357 | #ifdef RSS |
| 358 | netisr_unregister_vnet(&ip6_direct_nh); |
| 359 | #endif |
| 360 | netisr_unregister_vnet(&ip6_nh); |
| 361 | |
| 362 | pfil_head_unregister(V_inet6_pfil_head); |
| 363 | error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET6]); |
| 364 | if (error != 0) { |
| 365 | printf("%s: WARNING: unable to deregister input helper hook " |
| 366 | "type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET6: " |
| 367 | "error %d returned\n", __func__, error); |
| 368 | } |
| 369 | error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET6]); |
| 370 | if (error != 0) { |
| 371 | printf("%s: WARNING: unable to deregister output helper hook " |
| 372 | "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: " |
| 373 | "error %d returned\n", __func__, error); |
| 374 | } |
| 375 | |
| 376 | /* Cleanup addresses. */ |
| 377 | IFNET_RLOCK(); |
| 378 | CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { |
| 379 | /* Cannot lock here - lock recursion. */ |
| 380 | /* IF_ADDR_LOCK(ifp); */ |
| 381 | CK_STAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { |
| 382 | if (ifa->ifa_addr->sa_family != AF_INET6) |
| 383 | continue; |
| 384 | in6_purgeaddr(ifa); |
| 385 | } |
| 386 | /* IF_ADDR_UNLOCK(ifp); */ |
| 387 | in6_ifdetach_destroy(ifp); |
| 388 | mld_domifdetach(ifp); |
| 389 | } |
| 390 | IFNET_RUNLOCK(); |
| 391 | |
| 392 | /* Make sure any routes are gone as well. */ |
| 393 | rib_flush_routes_family(AF_INET6); |
| 394 | |
| 395 | frag6_destroy(); |
| 396 | nd6_destroy(); |
| 397 | in6_ifattach_destroy(); |
| 398 | |
| 399 | hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); |
| 400 | } |
| 401 | |
| 402 | VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip6_destroy, NULL); |
| 403 | #endif |
nothing calls this directly
no test coverage detected