zebra: Fix distance being set incorrectly on kernel offload update

When we are notified about the kernel about a route being offloaded
or not correctly set the distance.

Ticket: CM-33097
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-01-05 14:23:51 -05:00
parent b6e91c32e8
commit 1cd8bd054c

View File

@ -2711,10 +2711,6 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
if (ere->src_p_provided)
apply_mask_ipv6(&ere->src_p);
/* Set default distance by route type. */
if (re->distance == 0)
re->distance = route_distance(re->type);
/* Lookup route node.*/
rn = srcdest_rnode_get(table, &ere->p,
ere->src_p_provided ? &ere->src_p : NULL);
@ -2761,6 +2757,14 @@ static void process_subq_early_route_add(struct zebra_early_route *ere)
}
}
/* Set default distance by route type. */
if (re->distance == 0) {
if (same && !zebra_router_notify_on_ack())
re->distance = same->distance;
else
re->distance = route_distance(re->type);
}
/* If this route is kernel/connected route, notify the dataplane. */
if (RIB_SYSTEM_ROUTE(re)) {
/* Notify dataplane */