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

Function ng_bridge_disconnect

freebsd/netgraph/ng_bridge.c:843–863  ·  view source on GitHub ↗

* Hook disconnection. */

Source from the content-addressed store, hash-verified

841 * Hook disconnection.
842 */
843static int
844ng_bridge_disconnect(hook_p hook)
845{
846 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
847 link_p link = NG_HOOK_PRIVATE(hook);
848
849 /* Remove all hosts associated with this link */
850 ng_bridge_remove_hosts(priv, link);
851
852 /* Free associated link information */
853 free(link, M_NETGRAPH_BRIDGE);
854 priv->numLinks--;
855
856 /* If no more hooks, go away */
857 if ((NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0)
858 && (NG_NODE_IS_VALID(NG_HOOK_NODE(hook)))
859 && !priv->persistent) {
860 ng_rmnode_self(NG_HOOK_NODE(hook));
861 }
862 return (0);
863}
864
865/******************************************************************
866 HASH TABLE FUNCTIONS

Callers

nothing calls this directly

Calls 3

ng_bridge_remove_hostsFunction · 0.85
ng_rmnode_selfFunction · 0.70
freeFunction · 0.50

Tested by

no test coverage detected