* Shutdown processing. */
| 610 | * Shutdown processing. |
| 611 | */ |
| 612 | static int |
| 613 | ng_eiface_rmnode(node_p node) |
| 614 | { |
| 615 | const priv_p priv = NG_NODE_PRIVATE(node); |
| 616 | struct ifnet *const ifp = priv->ifp; |
| 617 | |
| 618 | /* |
| 619 | * the ifnet may be in a different vnet than the netgraph node, |
| 620 | * hence we have to change the current vnet context here. |
| 621 | */ |
| 622 | CURVNET_SET_QUIET(ifp->if_vnet); |
| 623 | ether_ifdetach(ifp); |
| 624 | ifmedia_removeall(&priv->media); |
| 625 | if_free(ifp); |
| 626 | CURVNET_RESTORE(); |
| 627 | free_unr(V_ng_eiface_unit, priv->unit); |
| 628 | free(priv, M_NETGRAPH); |
| 629 | NG_NODE_SET_PRIVATE(node, NULL); |
| 630 | NG_NODE_UNREF(node); |
| 631 | return (0); |
| 632 | } |
| 633 | |
| 634 | /* |
| 635 | * Hook disconnection |
nothing calls this directly
no test coverage detected