* bridge_rttrim: * * Trim the routine table so that we have a number * of routing entries less than or equal to the * maximum number. */
| 2780 | * maximum number. |
| 2781 | */ |
| 2782 | static void |
| 2783 | bridge_rttrim(struct bridge_softc *sc) |
| 2784 | { |
| 2785 | struct bridge_rtnode *brt, *nbrt; |
| 2786 | |
| 2787 | NET_EPOCH_ASSERT(); |
| 2788 | BRIDGE_RT_LOCK_ASSERT(sc); |
| 2789 | |
| 2790 | /* Make sure we actually need to do this. */ |
| 2791 | if (sc->sc_brtcnt <= sc->sc_brtmax) |
| 2792 | return; |
| 2793 | |
| 2794 | /* Force an aging cycle; this might trim enough addresses. */ |
| 2795 | bridge_rtage(sc); |
| 2796 | if (sc->sc_brtcnt <= sc->sc_brtmax) |
| 2797 | return; |
| 2798 | |
| 2799 | CK_LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) { |
| 2800 | if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) { |
| 2801 | bridge_rtnode_destroy(sc, brt); |
| 2802 | if (sc->sc_brtcnt <= sc->sc_brtmax) |
| 2803 | return; |
| 2804 | } |
| 2805 | } |
| 2806 | } |
| 2807 | |
| 2808 | /* |
| 2809 | * bridge_timer: |
no test coverage detected