[bgpd] Bug #240, Fix route-server crash when static routes are configured

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.
This commit is contained in:
Paul Jakma 2006-05-08 14:37:17 +00:00
parent 7a559cbe8f
commit da5b30f6fb
2 changed files with 11 additions and 2 deletions

View File

@ -2,6 +2,10 @@
* bgp_community.c: (community_str2com) Coverity CID#62, fix * bgp_community.c: (community_str2com) Coverity CID#62, fix
double-free, use-after-free. 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> 2006-05-04 Paul Jakma <paul.jakma@sun.com>

View File

@ -66,6 +66,10 @@ bgp_afi_node_get (struct bgp_table *table, afi_t afi, safi_t safi, struct prefix
struct bgp_node *rn; struct bgp_node *rn;
struct bgp_node *prn = NULL; struct bgp_node *prn = NULL;
assert (table);
if (!table)
return NULL;
if (safi == SAFI_MPLS_VPN) if (safi == SAFI_MPLS_VPN)
{ {
prn = bgp_node_get (table, (struct prefix *) prd); prn = bgp_node_get (table, (struct prefix *) prd);
@ -3177,6 +3181,7 @@ bgp_static_update (struct bgp *bgp, struct prefix *p,
for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, rsclient)) for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, rsclient))
{ {
if (CHECK_FLAG (rsclient->af_flags[afi][safi], PEER_FLAG_RSERVER_CLIENT))
bgp_static_update_rsclient (rsclient, p, bgp_static, afi, safi); bgp_static_update_rsclient (rsclient, p, bgp_static, afi, safi);
} }
} }