]> git.puffer.fish Git - mirror/frr.git/commitdiff
[bgpd] Bug #240, Fix route-server crash when static routes are configured
authorPaul Jakma <paul.jakma@sun.com>
Mon, 8 May 2006 14:37:17 +0000 (14:37 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Mon, 8 May 2006 14:37:17 +0000 (14:37 +0000)
2006-05-08 Paul Jakma <paul.jakma@sun.com>

* bgp_route.c: (bgp_afi_node_get) given table should never be
  NULL, check/assert this.
  (bgp_static_update) Bug #240. Rsclients should only be passed
  the static update if they are configured for the afi,safi.

bgpd/ChangeLog
bgpd/bgp_route.c

index 16a56fc2b94bc30d644b10559c150410ec596527..21a4a56b08a9d0273f6901873562e05ab70826fe 100644 (file)
@@ -2,6 +2,10 @@
 
        * bgp_community.c: (community_str2com) Coverity CID#62, fix
          double-free, use-after-free.
+       * bgp_route.c: (bgp_afi_node_get) given table should never be
+         NULL, check/assert this.
+         (bgp_static_update) Bug #240. Rsclients should only be passed
+         the static update if they are configured for the afi,safi.
 
 2006-05-04 Paul Jakma <paul.jakma@sun.com>
 
index 10c88697921aedbe5af6e545aba03a8c139e8144..f5d69e887a60a86ca5a5153edd75253720c3fbfb 100644 (file)
@@ -65,7 +65,11 @@ bgp_afi_node_get (struct bgp_table *table, afi_t afi, safi_t safi, struct prefix
 {
   struct bgp_node *rn;
   struct bgp_node *prn = NULL;
-
+  
+  assert (table);
+  if (!table)
+    return NULL;
+  
   if (safi == SAFI_MPLS_VPN)
     {
       prn = bgp_node_get (table, (struct prefix *) prd);
@@ -3177,7 +3181,8 @@ bgp_static_update (struct bgp *bgp, struct prefix *p,
 
   for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, rsclient))
     {
-      bgp_static_update_rsclient (rsclient, p, bgp_static, afi, safi);
+      if (CHECK_FLAG (rsclient->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
+        bgp_static_update_rsclient (rsclient, p, bgp_static, afi, safi);
     }
 }