* bridge_clone_destroy: * * Destroy a bridge instance. */
| 741 | * Destroy a bridge instance. |
| 742 | */ |
| 743 | static void |
| 744 | bridge_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: |
nothing calls this directly
no test coverage detected