mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
zebra: When processing route_entries ignore unusable routes
When zebra is processing routes to determine what to send to the rib, suppose we have two routes (a) a route processed earlier that none of it's nexthops were active and (b) a route that has good nexthops but has a worse admin distance. rib_process, would not relook at (a)'s nexthops because the ROUTE_ENTRY_CHANGED flag was not true and it would win when compared to (b) because it's admin distance was better, leaving us with a state where we would attempt and fail to install route (a) because it was not valid. Modify the code to consider the number of nexthops we have as a determiner if we can use the route. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
5c18e66208
commit
9d221fac7e
@ -1098,38 +1098,38 @@ static void rib_process(struct route_node *rn)
|
|||||||
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
|
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Skip unreachable nexthop. */
|
/*
|
||||||
/* This first call to nexthop_active_update is merely to
|
* If the route entry has changed, verify/resolve
|
||||||
* determine if there's any change to nexthops associated
|
* the nexthops associated with the entry.
|
||||||
* with this RIB entry. Now, rib_process() can be invoked due
|
*
|
||||||
* to an external event such as link down or due to
|
* In any event if we have nexthops that are not active
|
||||||
* next-hop-tracking evaluation. In the latter case,
|
* then we cannot use this particular route entry so
|
||||||
* a decision has already been made that the NHs have changed.
|
* skip it.
|
||||||
* So, no need to invoke a potentially expensive call again.
|
|
||||||
* Further, since the change might be in a recursive NH which
|
|
||||||
* is not caught in the nexthop_active_update() code. Thus, we
|
|
||||||
* might miss changes to recursive NHs.
|
|
||||||
*/
|
*/
|
||||||
if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)
|
if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)) {
|
||||||
&& !nexthop_active_update(rn, re)) {
|
if (!nexthop_active_update(rn, re)) {
|
||||||
if (re->type == ZEBRA_ROUTE_TABLE) {
|
if (re->type == ZEBRA_ROUTE_TABLE) {
|
||||||
/* XXX: HERE BE DRAGONS!!!!!
|
/* XXX: HERE BE DRAGONS!!!!!
|
||||||
* In all honesty, I have not yet figured out
|
* In all honesty, I have not yet
|
||||||
* what this part does or why the
|
* figured out what this part does or
|
||||||
* ROUTE_ENTRY_CHANGED test above is correct
|
* why the ROUTE_ENTRY_CHANGED test
|
||||||
* or why we need to delete a route here, and
|
* above is correct or why we need to
|
||||||
* also not whether this concerns both selected
|
* delete a route here, and also not
|
||||||
|
* whether this concerns both selected
|
||||||
* and fib route, or only selected
|
* and fib route, or only selected
|
||||||
* or only fib
|
* or only fib
|
||||||
*
|
*
|
||||||
* This entry was denied by the 'ip protocol
|
* This entry was denied by the 'ip
|
||||||
* table' route-map, we need to delete it */
|
* protocol
|
||||||
|
* table' route-map, we need to delete
|
||||||
|
* it */
|
||||||
if (re != old_selected) {
|
if (re != old_selected) {
|
||||||
if (IS_ZEBRA_DEBUG_RIB)
|
if (IS_ZEBRA_DEBUG_RIB)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: %s(%u):%s: imported via import-table but denied by the ip protocol table route-map",
|
"%s: %s(%u):%s: imported via import-table but denied by the ip protocol table route-map",
|
||||||
__func__,
|
__func__,
|
||||||
VRF_LOGNAME(vrf),
|
VRF_LOGNAME(
|
||||||
|
vrf),
|
||||||
vrf_id, buf);
|
vrf_id, buf);
|
||||||
rib_unlink(rn, re);
|
rib_unlink(rn, re);
|
||||||
} else
|
} else
|
||||||
@ -1139,6 +1139,16 @@ static void rib_process(struct route_node *rn)
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
* If the re has not changed and the nhg we have is
|
||||||
|
* not usable, then we cannot use this route entry
|
||||||
|
* for consideration, as that the route will just
|
||||||
|
* not install if it is selected.
|
||||||
|
*/
|
||||||
|
if (!nexthop_group_active_nexthop_num(&re->nhe->nhg))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Infinite distance. */
|
/* Infinite distance. */
|
||||||
if (re->distance == DISTANCE_INFINITY &&
|
if (re->distance == DISTANCE_INFINITY &&
|
||||||
|
Loading…
Reference in New Issue
Block a user