* An Ethernet interface is being detached. * REALLY Destroy its node. */
| 351 | * REALLY Destroy its node. |
| 352 | */ |
| 353 | static void |
| 354 | ng_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. |
no test coverage detected