summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 9551f26d80..81910f68b7 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1306,6 +1306,7 @@ static void rib_process(struct route_node *rn)
vrf),
vrf_id, rn);
rib_unlink(rn, re);
+ continue;
} else
SET_FLAG(re->status,
ROUTE_ENTRY_REMOVED);
@@ -2711,10 +2712,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 +2758,22 @@ 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 (re->metric == ROUTE_INSTALLATION_METRIC &&
+ CHECK_FLAG(re->flags, ZEBRA_FLAG_SELFROUTE)) {
+ if (same && !zebra_router_notify_on_ack())
+ re->metric = same->metric;
+ else
+ re->metric = 0;
+ }
+
/* If this route is kernel/connected route, notify the dataplane. */
if (RIB_SYSTEM_ROUTE(re)) {
/* Notify dataplane */