MCPcopy Create free account
hub / github.com/F-Stack/f-stack / if_detach

Function if_detach

freebsd/net/if.c:1118–1131  ·  view source on GitHub ↗

* Detach an interface, removing it from the list of "active" interfaces. * If vmove flag is set on entry to if_detach_internal(), perform only a * limited subset of cleanup tasks, given that we are moving an ifnet from * one vnet to another, where it must be fully operational. * * XXXRW: There are some significant questions about event ordering, and * how to prevent things from starting to u

Source from the content-addressed store, hash-verified

1116 * how to prevent things from starting to use the interface during detach.
1117 */
1118void
1119if_detach(struct ifnet *ifp)
1120{
1121 bool found;
1122
1123 CURVNET_SET_QUIET(ifp->if_vnet);
1124 found = if_unlink_ifnet(ifp, false);
1125 if (found) {
1126 sx_xlock(&ifnet_detach_sxlock);
1127 if_detach_internal(ifp, 0, NULL);
1128 sx_xunlock(&ifnet_detach_sxlock);
1129 }
1130 CURVNET_RESTORE();
1131}
1132
1133/*
1134 * The vmove flag, if set, indicates that we are called from a callpath

Callers 15

pflog_clone_destroyFunction · 0.85
pfsync_clone_destroyFunction · 0.85
ipfw_clone_destroyFunction · 0.85
ipfw_clone_createFunction · 0.85
ipfwlog_clone_createFunction · 0.85
X_ip6_mrouter_doneFunction · 0.85
del_m6if_lockedFunction · 0.85
iflib_pseudo_deregisterFunction · 0.85
stf_clone_destroyFunction · 0.85
gre_clone_destroyFunction · 0.85
ether_ifdetachFunction · 0.85
firewire_ifdetachFunction · 0.85

Calls 2

if_unlink_ifnetFunction · 0.85
if_detach_internalFunction · 0.85

Tested by

no test coverage detected