]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing
authorPaul Jakma <paul.jakma@hpe.com>
Tue, 1 Dec 2015 14:32:11 +0000 (14:32 +0000)
committervivek <vivek@cumulusnetworks.com>
Mon, 6 Jun 2016 19:35:29 +0000 (12:35 -0700)
* bgp_nexthop.c: (bgp_scan) There is little point queueing an rn with no routing
  information for processing.
* bgp_route.c: (bgp_process) Do nothing on rn's with no routes. Add an assert
  for now, to try catch any other cases, but prob should be removed.
  (bgp_best_selection) rn with no routes == finish early.

(cherry picked from commit 91b9e8547a7c5697d5d7481f9476778077024019)

Conflicts:
bgpd/bgp_nexthop.c
bgpd/bgp_route.c

bgpd/bgp_route.c

index f04d6db53bedcb405d86e616f9ecefb08c1e31d7..adc6407bb9a7d1d05744b5093a7f9420de1d7be7 100644 (file)
@@ -1520,6 +1520,17 @@ bgp_best_selection (struct bgp *bgp, struct bgp_node *rn,
   char pfx_buf[PREFIX2STR_BUFFER];
   char path_buf[PATH_ADDPATH_STR_BUFFER];
 
+  result->old = result->new = NULL;
+  
+  if (rn->info == NULL)
+    {
+      char buf[PREFIX2STR_BUFFER];
+      zlog_warn ("%s: Called for route_node %s with no routing entries!",
+                 __func__,
+                 prefix2str (&(bgp_node_to_rnode (rn)->p), buf, sizeof(buf)));
+      return;
+    }
+  
   bgp_mp_list_init (&mp_list);
   do_mpath = (mpath_cfg->maxpaths_ebgp > 1 || mpath_cfg->maxpaths_ibgp > 1);
 
@@ -1908,6 +1919,19 @@ bgp_process (struct bgp *bgp, struct bgp_node *rn, afi_t afi, safi_t safi)
   if (CHECK_FLAG (rn->flags, BGP_NODE_PROCESS_SCHEDULED))
     return;
 
+  if (rn->info == NULL)
+    {
+      /* XXX: Perhaps remove before next release, after we've flushed out
+       * any obvious cases
+       */
+      assert (rn->info != NULL);
+      char buf[PREFIX2STR_BUFFER];
+      zlog_warn ("%s: Called for route_node %s with no routing entries!",
+                 __func__,
+                 prefix2str (&(bgp_node_to_rnode (rn)->p), buf, sizeof(buf)));
+      return;
+    }
+  
   if (bm->process_main_queue == NULL)
     bgp_process_queue_init ();