| 1130 | } |
| 1131 | |
| 1132 | static int |
| 1133 | vlan_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. |
nothing calls this directly
no test coverage detected