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

Function bridge_rtable_expire

freebsd/net/if_bridge.c:3108–3134  ·  view source on GitHub ↗

* bridge_rtable_expire: * * Set the expiry time for all routes on an interface. */

Source from the content-addressed store, hash-verified

3106 * Set the expiry time for all routes on an interface.
3107 */
3108static void
3109bridge_rtable_expire(struct ifnet *ifp, int age)
3110{
3111 struct bridge_softc *sc = ifp->if_bridge;
3112 struct bridge_rtnode *brt;
3113
3114 CURVNET_SET(ifp->if_vnet);
3115 BRIDGE_RT_LOCK(sc);
3116
3117 /*
3118 * If the age is zero then flush, otherwise set all the expiry times to
3119 * age for the interface
3120 */
3121 if (age == 0)
3122 bridge_rtdelete(sc, ifp, IFBF_FLUSHDYN);
3123 else {
3124 CK_LIST_FOREACH(brt, &sc->sc_rtlist, brt_list) {
3125 /* Cap the expiry time to 'age' */
3126 if (brt->brt_ifp == ifp &&
3127 brt->brt_expire > time_uptime + age &&
3128 (brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC)
3129 brt->brt_expire = time_uptime + age;
3130 }
3131 }
3132 BRIDGE_RT_UNLOCK(sc);
3133 CURVNET_RESTORE();
3134}
3135
3136/*
3137 * bridge_state_change:

Callers

nothing calls this directly

Calls 1

bridge_rtdeleteFunction · 0.85

Tested by

no test coverage detected