Changeset View
Changeset View
Standalone View
Standalone View
sys/net/if.c
Show First 20 Lines • Show All 868 Lines • ▼ Show 20 Lines | #ifdef INET6 | ||||
* before removing routing entries below, since IPv6 interface direct | * before removing routing entries below, since IPv6 interface direct | ||||
* routes are expected to be removed by the IPv6-specific kernel API. | * routes are expected to be removed by the IPv6-specific kernel API. | ||||
* Otherwise, the kernel will detect some inconsistency and bark it. | * Otherwise, the kernel will detect some inconsistency and bark it. | ||||
*/ | */ | ||||
in6_ifdetach(ifp); | in6_ifdetach(ifp); | ||||
#endif | #endif | ||||
if_purgemaddrs(ifp); | if_purgemaddrs(ifp); | ||||
/* Announce that the interface is gone. */ | |||||
rt_ifannouncemsg(ifp, IFAN_DEPARTURE); | |||||
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); | |||||
if (IS_DEFAULT_VNET(curvnet)) | |||||
devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); | |||||
if (!vmove) { | if (!vmove) { | ||||
/* | /* | ||||
* Prevent further calls into the device driver via ifnet. | * Prevent further calls into the device driver via ifnet. | ||||
*/ | */ | ||||
if_dead(ifp); | if_dead(ifp); | ||||
/* | /* | ||||
* Remove link ifaddr pointer and maybe decrement if_index. | * Remove link ifaddr pointer and maybe decrement if_index. | ||||
Show All 21 Lines | for (j = 0; j < rt_numfibs; j++) { | ||||
if (rnh == NULL) | if (rnh == NULL) | ||||
continue; | continue; | ||||
RADIX_NODE_HEAD_LOCK(rnh); | RADIX_NODE_HEAD_LOCK(rnh); | ||||
(void) rnh->rnh_walktree(rnh, if_rtdel, ifp); | (void) rnh->rnh_walktree(rnh, if_rtdel, ifp); | ||||
RADIX_NODE_HEAD_UNLOCK(rnh); | RADIX_NODE_HEAD_UNLOCK(rnh); | ||||
} | } | ||||
} | } | ||||
/* Announce that the interface is gone. */ | |||||
rt_ifannouncemsg(ifp, IFAN_DEPARTURE); | |||||
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); | |||||
if (IS_DEFAULT_VNET(curvnet)) | |||||
devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); | |||||
if_delgroups(ifp); | if_delgroups(ifp); | ||||
/* | /* | ||||
* We cannot hold the lock over dom_ifdetach calls as they might | * We cannot hold the lock over dom_ifdetach calls as they might | ||||
* sleep, for example trying to drain a callout, thus open up the | * sleep, for example trying to drain a callout, thus open up the | ||||
* theoretical race with re-attaching. | * theoretical race with re-attaching. | ||||
*/ | */ | ||||
IF_AFDATA_LOCK(ifp); | IF_AFDATA_LOCK(ifp); | ||||
▲ Show 20 Lines • Show All 3,168 Lines • Show Last 20 Lines |