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

Function ng_ether_shutdown

freebsd/netgraph/ng_ether.c:748–772  ·  view source on GitHub ↗

* Shutdown node. This resets the node but does not remove it * unless the REALLY_DIE flag is set. */

Source from the content-addressed store, hash-verified

746 * unless the REALLY_DIE flag is set.
747 */
748static int
749ng_ether_shutdown(node_p node)
750{
751 const priv_p priv = NG_NODE_PRIVATE(node);
752
753 if (node->nd_flags & NGF_REALLY_DIE) {
754 /*
755 * The ifnet is going away, perhaps because the driver was
756 * unloaded or its vnet is being torn down.
757 */
758 NG_NODE_SET_PRIVATE(node, NULL);
759 if (priv->ifp != NULL)
760 IFP2NG(priv->ifp) = NULL;
761 free(priv, M_NETGRAPH);
762 NG_NODE_UNREF(node); /* free node itself */
763 return (0);
764 }
765 if (priv->promisc) { /* disable promiscuous mode */
766 (void)ifpromisc(priv->ifp, 0);
767 priv->promisc = 0;
768 }
769 NG_NODE_REVIVE(node); /* Signal ng_rmnode we are persisant */
770
771 return (0);
772}
773
774/*
775 * Hook disconnection.

Callers

nothing calls this directly

Calls 2

ifpromiscFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected