diff options
-rw-r--r-- | bgpd/bgp_route.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index ce0b57b9..cd8f3fea 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4660,18 +4660,27 @@ bgp_aggregate_increment (struct bgp *bgp, struct prefix *p, struct bgp_node *child; struct bgp_node *rn; struct bgp_aggregate *aggregate; + struct bgp_table *table; /* MPLS-VPN aggregation is not yet supported. */ if (safi == SAFI_MPLS_VPN) return; + table = bgp->aggregate[afi][safi]; + + /* No aggregates configured. */ + if (table->top == NULL) + return; + if (p->prefixlen == 0) return; if (BGP_INFO_HOLDDOWN (ri)) return; - child = bgp_node_get (bgp->aggregate[afi][safi], p); + child = bgp_node_lookup (table, p); + if (! child) + return; /* Aggregate address configuration check. */ for (rn = child; rn; rn = rn->parent) @@ -4690,15 +4699,24 @@ bgp_aggregate_decrement (struct bgp *bgp, struct prefix *p, struct bgp_node *child; struct bgp_node *rn; struct bgp_aggregate *aggregate; + struct bgp_table *table; /* MPLS-VPN aggregation is not yet supported. */ if (safi == SAFI_MPLS_VPN) return; + table = bgp->aggregate[afi][safi]; + + /* No aggregates configured. */ + if (table->top == NULL) + return; + if (p->prefixlen == 0) return; - child = bgp_node_get (bgp->aggregate[afi][safi], p); + child = bgp_node_lookup (table, p); + if (! child) + return; /* Aggregate address configuration check. */ for (rn = child; rn; rn = rn->parent) |