| 229 | #endif /* VIMAGE */ |
| 230 | |
| 231 | static void |
| 232 | ipsec_clone_destroy(struct ifnet *ifp) |
| 233 | { |
| 234 | struct ipsec_softc *sc; |
| 235 | |
| 236 | sx_xlock(&ipsec_ioctl_sx); |
| 237 | sc = ifp->if_softc; |
| 238 | ipsec_delete_tunnel(sc); |
| 239 | /* |
| 240 | * Delete softc from idhash on interface destroy, since |
| 241 | * ipsec_delete_tunnel() keeps reqid unchanged. |
| 242 | */ |
| 243 | if (sc->reqid != 0) |
| 244 | CK_LIST_REMOVE(sc, idhash); |
| 245 | bpfdetach(ifp); |
| 246 | if_detach(ifp); |
| 247 | ifp->if_softc = NULL; |
| 248 | sx_xunlock(&ipsec_ioctl_sx); |
| 249 | |
| 250 | IPSEC_WAIT(); |
| 251 | if_free(ifp); |
| 252 | free(sc, M_IPSEC); |
| 253 | } |
| 254 | |
| 255 | static struct ipsec_iflist * |
| 256 | ipsec_hashinit(void) |
nothing calls this directly
no test coverage detected