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

Function gre_delete_tunnel

freebsd/net/if_gre.c:396–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396static void
397gre_delete_tunnel(struct gre_softc *sc)
398{
399 struct gre_socket *gs;
400
401 sx_assert(&gre_ioctl_sx, SA_XLOCKED);
402 if (sc->gre_family != 0) {
403 CK_LIST_REMOVE(sc, chain);
404 CK_LIST_REMOVE(sc, srchash);
405 GRE_WAIT();
406 free(sc->gre_hdr, M_GRE);
407 sc->gre_family = 0;
408 }
409 /*
410 * If this Tunnel was the last one that could use UDP socket,
411 * we should unlink socket from hash table and close it.
412 */
413 if ((gs = sc->gre_so) != NULL && CK_LIST_EMPTY(&gs->list)) {
414 CK_LIST_REMOVE(gs, chain);
415 soclose(gs->so);
416 NET_EPOCH_CALL(gre_sofree, &gs->epoch_ctx);
417 sc->gre_so = NULL;
418 }
419 GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING;
420 if_link_state_change(GRE2IFP(sc), LINK_STATE_DOWN);
421}
422
423struct gre_list *
424gre_hashinit(void)

Callers 3

gre_reassignFunction · 0.85
gre_clone_destroyFunction · 0.85
gre_ioctlFunction · 0.85

Calls 3

socloseFunction · 0.85
if_link_state_changeFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected