On Mon, 30 Nov 2015, Paul Jakma wrote:

This one breaks.

Interestingly, issue is that bgp_scan is queueing up route_nodes with no routes. Which breaks the changes I made to have mpath in route-selection get its config. Still havn't tested mpath with my changes, but fixing bgp_scan to not do this is probably generally a good thing. The assert would be good to keep for a while, during testing, to catch any others, and removed later.

regards,
--
Paul Jakma      [email protected]  @pjakma Key ID: 64A2FF6A
Fortune:
In case of atomic attack, the federal ruling against prayer in schools
will be temporarily canceled.


-----8<---------8<---------8<---------8<---------8<---------8<----
From 25f4627bcd69f97475290edc22bb69baa5147859 Mon Sep 17 00:00:00 2001
From: Paul Jakma <[email protected]>
Date: Tue, 1 Dec 2015 14:32:11 +0000
Subject: bgpd: bgp_scan shouldn't queue up route_nodes with no routes for
 processing

* 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.

diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index 145a1d8..607d99b 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -496,7 +496,8 @@ bgp_scan (afi_t afi, safi_t safi)
                                           afi, SAFI_UNICAST);
            }
        }
-      bgp_process (bgp, rn, afi, SAFI_UNICAST);
+      if (rn->info)
+        bgp_process (bgp, rn, afi, SAFI_UNICAST);
     }

   /* Flash old cache. */
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 74b4363..9c1e18f 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -1485,6 +1485,17 @@ bgp_best_selection (struct bgp *bgp, struct bgp_node *rn,
   int cmpret, do_mpath;
   struct list mp_list;

+  result->old = result->new = NULL;
+ + if (rn->info == NULL)
+    {
+      char buf[PREFIX_STRLEN];
+      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 = bgp_mpath_is_configured (bgp, afi, safi);

@@ -1605,7 +1616,6 @@ bgp_best_selection (struct bgp *bgp, struct bgp_node *rn,
             bgp_mp_list_add (&mp_list, ri);
         }
     }
-

   if (!bgp_flag_check (bgp, BGP_FLAG_DETERMINISTIC_MED))
     bgp_info_mpath_update (rn, new_select, old_select, &mp_list, afi, safi);
@@ -1862,6 +1872,18 @@ 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[PREFIX_STRLEN];
+      zlog_warn ("%s: Called for route_node %s with no routing entries!",
+                 __func__,
+                 prefix2str (&(bgp_node_to_rnode (rn)->p), buf, sizeof(buf)));
+    }
+
   if ( (bm->process_main_queue == NULL) ||
        (bm->process_rsclient_queue == NULL) )
     bgp_process_queue_init ();

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to