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

Function ng_ether_detach

freebsd/netgraph/ng_ether.c:353–369  ·  view source on GitHub ↗

* An Ethernet interface is being detached. * REALLY Destroy its node. */

Source from the content-addressed store, hash-verified

351 * REALLY Destroy its node.
352 */
353static void
354ng_ether_detach(struct ifnet *ifp)
355{
356 const node_p node = IFP2NG(ifp);
357 const priv_p priv = NG_NODE_PRIVATE(node);
358
359 taskqueue_drain(taskqueue_swi, &ifp->if_linktask);
360 NG_NODE_REALLY_DIE(node); /* Force real removal of node */
361 /*
362 * We can't assume the ifnet is still around when we run shutdown
363 * So zap it now. XXX We HOPE that anything running at this time
364 * handles it (as it should in the non netgraph case).
365 */
366 IFP2NG(ifp) = NULL;
367 priv->ifp = NULL; /* XXX race if interrupted an output packet */
368 ng_rmnode_self(node); /* remove all netgraph parts */
369}
370
371/*
372 * Notify graph about link event.

Callers 1

ng_ether_rcvmsgFunction · 0.85

Calls 2

taskqueue_drainFunction · 0.85
ng_rmnode_selfFunction · 0.70

Tested by

no test coverage detected