]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgp_recalculate_all_bestpaths() should check if rn->info is NULL
authorDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 17 Jun 2016 13:44:35 +0000 (13:44 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 17 Jun 2016 13:44:35 +0000 (13:44 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11444

The bgp table may contain nodes without an 'info' (these nodes are used
for balancing the tree, they are created by route_common() in lib/table.c).
When we call bgp_recalculate_all_bestpaths() we should avoid calling
bgp_process() for these nodes.  bgp_recalculate_all_bestpaths() is only
called when knobs are configured that could have an impact on which
routes are selected as best.

bgpd/bgpd.c

index bab20fc88f17454de8884763f6cb94f2db7c9215..243e800a89c10decb7cb65d3a2a1fe1835eff6af 100644 (file)
@@ -1395,7 +1395,10 @@ bgp_recalculate_all_bestpaths (struct bgp *bgp)
         {
           for (rn = bgp_table_top (bgp->rib[afi][safi]); rn; rn = bgp_route_next (rn))
             {
-              bgp_process (bgp, rn, afi, safi);
+              if (rn->info != NULL)
+                {
+                  bgp_process (bgp, rn, afi, safi);
+                }
             }
         }
     }