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

Function vlan_clone_destroy

freebsd/net/if_vlan.c:1132–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130}
1131
1132static int
1133vlan_clone_destroy(struct if_clone *ifc, struct ifnet *ifp)
1134{
1135 struct ifvlan *ifv = ifp->if_softc;
1136 int unit = ifp->if_dunit;
1137
1138 if (ifp->if_vlantrunk)
1139 return (EBUSY);
1140
1141 ether_ifdetach(ifp); /* first, remove it from system-wide lists */
1142 vlan_unconfig(ifp); /* now it can be unconfigured and freed */
1143 /*
1144 * We should have the only reference to the ifv now, so we can now
1145 * drain any remaining lladdr task before freeing the ifnet and the
1146 * ifvlan.
1147 */
1148 taskqueue_drain(taskqueue_thread, &ifv->lladdr_task);
1149 NET_EPOCH_WAIT();
1150 if_free(ifp);
1151 free(ifv, M_VLAN);
1152 if (unit != IF_DUNIT_NONE)
1153 ifc_free_unit(ifc, unit);
1154
1155 return (0);
1156}
1157
1158/*
1159 * The ifp->if_init entry point for vlan(4) is a no-op.

Callers

nothing calls this directly

Calls 6

ether_ifdetachFunction · 0.85
vlan_unconfigFunction · 0.85
taskqueue_drainFunction · 0.85
if_freeFunction · 0.85
ifc_free_unitFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected