]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_rib.c
Merge pull request #5793 from ton31337/fix/formatting_show_bgp_summary_failed
[mirror_frr.git] / zebra / zebra_rib.c
index f375036db2bb597d5c839cc47bc56efe59aa78c7..f3112cc9c039bd564819e75cd8190fe60d529d95 100644 (file)
@@ -228,7 +228,7 @@ int route_entry_update_nhe(struct route_entry *re, struct nhg_hash_entry *new)
 
                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);
 
@@ -1075,7 +1075,8 @@ static void rib_process(struct route_node *rn)
                }
 
                /* 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;
                }
@@ -1898,11 +1899,6 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
                /* 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",
@@ -1921,12 +1917,13 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
 
                /* 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)
@@ -3118,8 +3115,6 @@ static struct rib_update_ctx *rib_update_ctx_init(vrf_id_t vrf_id,
 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)