[quagga-dev 10240] [PATCH] bgpd: fix crash in soft-reconfiguration

David Lamparter equinox at opensourcerouting.org
Fri Feb 1 15:06:50 GMT 2013


From: Christian Franke <chris at opensourcerouting.org>

Commit 8692c50652 introduced a bug where bgpd would crash on
soft-reconfiguration.

This happens e.g. when there are filtered unicast routes because
rn->info is NULL in that case, which the code did not account for.

Reported-by: Paweł Staszewski <pstaszewski at itcare.pl>
Cc: Jorge Boncompte [DTI2] <jorge at dti2.net>
Signed-off-by: Christian Franke <chris at opensourcerouting.org>
Signed-off-by: David Lamparter <equinox at opensourcerouting.org>
---
Thanks Paweł for reporting, thanks Christian for fixing.
Applying for .22.
 -David
---

 bgpd/bgp_route.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 8bc72d7..fb35fab 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2643,10 +2643,10 @@ bgp_soft_reconfig_table_rsclient (struct peer *rsclient, afi_t afi,
     for (ain = rn->adj_in; ain; ain = ain->next)
       {
         struct bgp_info *ri = rn->info;
+        u_char *tag = (ri && ri->extra) ? ri->extra->tag : NULL;
 
         bgp_update_rsclient (rsclient, afi, safi, ain->attr, ain->peer,
-                &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd,
-                (bgp_info_extra_get (ri))->tag);
+                &rn->p, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, prd, tag);
       }
 }
 
@@ -2690,10 +2690,11 @@ bgp_soft_reconfig_table (struct peer *peer, afi_t afi, safi_t safi,
 	if (ain->peer == peer)
 	  {
 	    struct bgp_info *ri = rn->info;
+	    u_char *tag = (ri && ri->extra) ? ri->extra->tag : NULL;
 
 	    ret = bgp_update (peer, &rn->p, ain->attr, afi, safi,
 			      ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
-			      prd, (bgp_info_extra_get (ri))->tag, 1);
+			      prd, tag, 1);
 
 	    if (ret < 0)
 	      {
-- 
1.7.12.4





More information about the Quagga-dev mailing list