summaryrefslogtreecommitdiff
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-08 14:37:17 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-08 14:37:17 +0000
commitda5b30f6fb9437f1dc3d05a48e5e17f78695f820 (patch)
treebaa0663a2aea52399162c3e8e69be7ef8f54a4c7 /bgpd/bgp_route.c
parent7a559cbe8f794d298419a8ada80a9f12933eceda (diff)
[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.
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 10c88697..f5d69e88 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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);
}
}