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

Function if_free

freebsd/net/if.c:714–731  ·  view source on GitHub ↗

* Deregister an interface and free the associated storage. */

Source from the content-addressed store, hash-verified

712 * Deregister an interface and free the associated storage.
713 */
714void
715if_free(struct ifnet *ifp)
716{
717
718 ifp->if_flags |= IFF_DYING; /* XXX: Locking */
719
720 CURVNET_SET_QUIET(ifp->if_vnet);
721 IFNET_WLOCK();
722 KASSERT(ifp == ifnet_byindex(ifp->if_index),
723 ("%s: freeing unallocated ifnet", ifp->if_xname));
724
725 ifindex_free_locked(ifp->if_index);
726 IFNET_WUNLOCK();
727
728 if (refcount_release(&ifp->if_refcount))
729 NET_EPOCH_CALL(if_destroy, &ifp->if_epoch_ctx);
730 CURVNET_RESTORE();
731}
732
733/*
734 * Interfaces to keep an ifnet type-stable despite the possibility of the

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
ieee80211_vap_detachFunction · 0.85
arge_detachFunction · 0.85
are_detachFunction · 0.85
cvm_oct_init_moduleFunction · 0.85
X_ip6_mrouter_doneFunction · 0.85
del_m6if_lockedFunction · 0.85
gen_destroyFunction · 0.85

Calls 3

ifnet_byindexFunction · 0.85
ifindex_free_lockedFunction · 0.85
refcount_releaseFunction · 0.85

Tested by

no test coverage detected