if (old)
zebra_nhg_decrement_ref(old);
- } else if (!re->nhe->nhg)
+ } else if (!re->nhe)
/* This is the first time it's being attached */
route_entry_attach_ref(re, new);
}
/* Infinite distance. */
- if (re->distance == DISTANCE_INFINITY) {
+ if (re->distance == DISTANCE_INFINITY &&
+ re->type != ZEBRA_ROUTE_KERNEL) {
UNSET_FLAG(re->status, ROUTE_ENTRY_CHANGED);
continue;
}
ctx_nexthop = dplane_ctx_get_ng(ctx)->nexthop;
+ /* Nothing installed - we can skip some of the checking/comparison
+ * of nexthops.
+ */
+ if (ctx_nexthop == NULL) {
+ changed_p = true;
+ goto no_nexthops;
+ }
+
/* Get the first `installed` one to check against.
* If the dataplane doesn't set these to be what was actually installed,
* it will just be whatever was in re->nhe->nhg?
goto done;
}
+no_nexthops:
+
/* FIB nexthop set differs from the RIB set:
* create a fib-specific nexthop-group
*/
/* Redistribute, lsp, and nht update */
redistribute_update(dest_pfx, src_pfx, re, NULL);
- zebra_rib_evaluate_rn_nexthops(
- rn, zebra_router_get_next_sequence());
-
- zebra_rib_evaluate_mpls(rn);
-
} else if (start_count > 0 && end_count == 0) {
if (debug_p)
zlog_debug("%u:%s un-installed transition from dplane notification",
/* Redistribute, lsp, and nht update */
redistribute_delete(dest_pfx, src_pfx, re, NULL);
+ }
- zebra_rib_evaluate_rn_nexthops(
- rn, zebra_router_get_next_sequence());
+ /* Make any changes visible for lsp and nexthop-tracking processing */
+ zebra_rib_evaluate_rn_nexthops(
+ rn, zebra_router_get_next_sequence());
- zebra_rib_evaluate_mpls(rn);
- }
+ zebra_rib_evaluate_mpls(rn);
done:
if (rn)
static void rib_update_ctx_fini(struct rib_update_ctx **ctx)
{
XFREE(MTYPE_RIB_UPDATE_CTX, *ctx);
-
- *ctx = NULL;
}
static int rib_update_handler(struct thread *thread)