diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-05 14:23:51 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-05 14:31:36 -0500 |
| commit | 1cd8bd054c6eafdcda1f5b1626f89622d170f536 (patch) | |
| tree | 682e4a33e63987cca7f1f7851c002f51824180a8 /zebra/zebra_rib.c | |
| parent | b6e91c32e844163ba986cfdee6606363e99c5f55 (diff) | |
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>
Diffstat (limited to 'zebra/zebra_rib.c')
| -rw-r--r-- | zebra/zebra_rib.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 9551f26d80..03f2591cfe 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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 */ |
