* bridge_rtable_expire: * * Set the expiry time for all routes on an interface. */
| 3106 | * Set the expiry time for all routes on an interface. |
| 3107 | */ |
| 3108 | static void |
| 3109 | bridge_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: |
nothing calls this directly
no test coverage detected