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

Function bridge_clone_destroy

freebsd/net/if_bridge.c:743–782  ·  view source on GitHub ↗

* bridge_clone_destroy: * * Destroy a bridge instance. */

Source from the content-addressed store, hash-verified

741 * Destroy a bridge instance.
742 */
743static void
744bridge_clone_destroy(struct ifnet *ifp)
745{
746 struct bridge_softc *sc = ifp->if_softc;
747 struct bridge_iflist *bif;
748 struct epoch_tracker et;
749
750 BRIDGE_LOCK(sc);
751
752 bridge_stop(ifp, 1);
753 ifp->if_flags &= ~IFF_UP;
754
755 while ((bif = CK_LIST_FIRST(&sc->sc_iflist)) != NULL)
756 bridge_delete_member(sc, bif, 0);
757
758 while ((bif = CK_LIST_FIRST(&sc->sc_spanlist)) != NULL) {
759 bridge_delete_span(sc, bif);
760 }
761
762 /* Tear down the routing table. */
763 bridge_rtable_fini(sc);
764
765 BRIDGE_UNLOCK(sc);
766
767 NET_EPOCH_ENTER(et);
768
769 callout_drain(&sc->sc_brcallout);
770
771 BRIDGE_LIST_LOCK();
772 LIST_REMOVE(sc, sc_list);
773 BRIDGE_LIST_UNLOCK();
774
775 bstp_detach(&sc->sc_stp);
776 NET_EPOCH_EXIT(et);
777
778 ether_ifdetach(ifp);
779 if_free(ifp);
780
781 NET_EPOCH_CALL(bridge_clone_destroy_cb, &sc->sc_epoch_ctx);
782}
783
784/*
785 * bridge_ioctl:

Callers

nothing calls this directly

Calls 7

bridge_stopFunction · 0.85
bridge_delete_memberFunction · 0.85
bridge_delete_spanFunction · 0.85
bridge_rtable_finiFunction · 0.85
bstp_detachFunction · 0.85
ether_ifdetachFunction · 0.85
if_freeFunction · 0.85

Tested by

no test coverage detected