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

Function ng_eiface_rmnode

freebsd/netgraph/ng_eiface.c:612–632  ·  view source on GitHub ↗

* Shutdown processing. */

Source from the content-addressed store, hash-verified

610 * Shutdown processing.
611 */
612static int
613ng_eiface_rmnode(node_p node)
614{
615 const priv_p priv = NG_NODE_PRIVATE(node);
616 struct ifnet *const ifp = priv->ifp;
617
618 /*
619 * the ifnet may be in a different vnet than the netgraph node,
620 * hence we have to change the current vnet context here.
621 */
622 CURVNET_SET_QUIET(ifp->if_vnet);
623 ether_ifdetach(ifp);
624 ifmedia_removeall(&priv->media);
625 if_free(ifp);
626 CURVNET_RESTORE();
627 free_unr(V_ng_eiface_unit, priv->unit);
628 free(priv, M_NETGRAPH);
629 NG_NODE_SET_PRIVATE(node, NULL);
630 NG_NODE_UNREF(node);
631 return (0);
632}
633
634/*
635 * Hook disconnection

Callers

nothing calls this directly

Calls 5

ether_ifdetachFunction · 0.85
ifmedia_removeallFunction · 0.85
if_freeFunction · 0.85
free_unrFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected