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

Function bridge_rttrim

freebsd/net/if_bridge.c:2782–2806  ·  view source on GitHub ↗

* bridge_rttrim: * * Trim the routine table so that we have a number * of routing entries less than or equal to the * maximum number. */

Source from the content-addressed store, hash-verified

2780 * maximum number.
2781 */
2782static void
2783bridge_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:

Callers 1

bridge_ioctl_scacheFunction · 0.85

Calls 2

bridge_rtageFunction · 0.85
bridge_rtnode_destroyFunction · 0.85

Tested by

no test coverage detected