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

Function ng_bridge_shutdown

freebsd/netgraph/ng_bridge.c:817–838  ·  view source on GitHub ↗

* Shutdown node */

Source from the content-addressed store, hash-verified

815 * Shutdown node
816 */
817static int
818ng_bridge_shutdown(node_p node)
819{
820 const priv_p priv = NG_NODE_PRIVATE(node);
821
822 /*
823 * Shut down everything including the timer. Even if the
824 * callout has already been dequeued and is about to be
825 * run, ng_bridge_timeout() won't be fired as the node
826 * is already marked NGF_INVALID, so we're safe to free
827 * the node now.
828 */
829 KASSERT(priv->numLinks == 0 && priv->numHosts == 0,
830 ("%s: numLinks=%d numHosts=%d",
831 __func__, priv->numLinks, priv->numHosts));
832 ng_uncallout(&priv->timer, node);
833 NG_NODE_SET_PRIVATE(node, NULL);
834 NG_NODE_UNREF(node);
835 free(priv->tab, M_NETGRAPH_BRIDGE);
836 free(priv, M_NETGRAPH_BRIDGE);
837 return (0);
838}
839
840/*
841 * Hook disconnection.

Callers

nothing calls this directly

Calls 2

ng_uncalloutFunction · 0.70
freeFunction · 0.50

Tested by

no test coverage detected