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

Function ipsec_clone_destroy

freebsd/net/if_ipsec.c:231–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229#endif /* VIMAGE */
230
231static void
232ipsec_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
255static struct ipsec_iflist *
256ipsec_hashinit(void)

Callers

nothing calls this directly

Calls 5

ipsec_delete_tunnelFunction · 0.85
bpfdetachFunction · 0.85
if_detachFunction · 0.85
if_freeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected