From: Daniel Walton Date: Fri, 17 Jun 2016 00:49:16 +0000 (+0000) Subject: Revert "bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing" X-Git-Tag: frr-2.0-rc1~530 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=69ae646b8d8f62c5e17766d4c6d2064d6796f687;p=mirror%2Ffrr.git Revert "bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing" This reverts commit ff75b6c05bb9ca1b9c4c48f2231fd4cbfd393b17. lib/table.c's route_common() can create a rn for a prefix that BGP has never RXed. For example here we RX 10.1.8.0/24 from neighbor 10.0.0.2, notice how the 10.1.0.0/20 entry is created. We would later assert on this prefix because its info was NULL. 2016/06/16 23:37:21.418426 BGP: 10.0.0.2 rcvd UPDATE w/ attr: nexthop 10.0.0.2, origin i, localpref 100, metric 0, community 99:7, path 2016/06/16 23:37:21.418442 BGP: 10.0.0.2 rcvd UPDATE wlen 0 wpfx 0 attrlen 36 alen 4 apfx 1 2016/06/16 23:37:21.418458 BGP: bgp_node_create called 2016/06/16 23:37:21.418475 BGP: route_node_get called for 10.1.8.0/24, route_node_new 10.1.0.0/20, match (nil) 2016/06/16 23:37:21.418519 BGP: bgp_node_create called 2016/06/16 23:37:21.418536 BGP: route_node_get called for 10.1.8.0/24, route_node_new(2) 10.1.8.0/24, match 0x2013cd0 2016/06/16 23:37:21.418554 BGP: 10.0.0.2 rcvd 10.1.8.0/24 If rn->info is NULL then avoiding the group_announce_route() call in bgp_proces_main() also feels risky as this code path generates WITHDRAWs for prefixes that no longer have a bestpath which would be the case if there are no paths. --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index a74d59ee32..fff595d190 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -1525,17 +1525,6 @@ 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); @@ -1924,19 +1913,6 @@ 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 ();