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

Function tun_uninit

freebsd/net/if_tuntap.c:701–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699 vnet_tun_uninit, NULL);
700
701static void
702tun_uninit(const void *unused __unused)
703{
704 struct tuntap_driver *drv;
705 struct tuntap_softc *tp;
706 int i;
707
708 EVENTHANDLER_DEREGISTER(ifnet_arrival_event, arrival_tag);
709 EVENTHANDLER_DEREGISTER(dev_clone, clone_tag);
710 drain_dev_clone_events();
711
712 mtx_lock(&tunmtx);
713 while ((tp = TAILQ_FIRST(&tunhead)) != NULL) {
714 TAILQ_REMOVE(&tunhead, tp, tun_list);
715 mtx_unlock(&tunmtx);
716 tun_destroy(tp);
717 mtx_lock(&tunmtx);
718 }
719 mtx_unlock(&tunmtx);
720 for (i = 0; i < nitems(tuntap_drivers); ++i) {
721 drv = &tuntap_drivers[i];
722 delete_unrhdr(drv->unrhdr);
723 clone_cleanup(&drv->clones);
724 }
725 mtx_destroy(&tunmtx);
726}
727SYSUNINIT(tun_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY, tun_uninit, NULL);
728
729static struct tuntap_driver *

Callers

nothing calls this directly

Calls 6

drain_dev_clone_eventsFunction · 0.85
tun_destroyFunction · 0.85
delete_unrhdrFunction · 0.85
clone_cleanupFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected