bgpd: When advertising a multipath route, the attribute set to be
advertised is based on the bestpath attribute set, but the
following attributes are aggregated from the attribute sets
of the multipath constituents:
- AS_PATH
- ORIGIN
- COMMUNITIES
- EXTENDED COMMUNITIES
In addition the route is advertised with the NEXT_HOP set
to the router's interface IP address, instead of the NEXT_HOP
of the best path. This is to ensure that traffic will go to this
router so it can be fanned out via the multipath route.
* bgpd/ecommunity.c
* ecommunity_uniq_sort(): Make this function externally accessible
* bgpd/ecommunity.h
* Add external declaration for ecommunity_uniq_sort()
* bgpd/bgp_mpath.c
* bgp_info_nexthop_cmp(): Replace calls to bgp_attr_extra_get()
to avoid unwanted memory allocation
* bgp_info_mpath_free(): Free aggregate attribute for multipath
* bgp_info_mpath_attr(): Lookup aggregate attribute of a multipath route
* bgp_info_mpath_attr_set(): Set aggregate attribute of a multipath route
* bgp_info_mpath_aggregate_update(): Update the aggregate attribute
of a multipath route
* bgpd/bgp_mpath.h
* bgp_info_mpath: Add pointer to hold aggregate attribute of a multipath
* Add external declarations for new functions
* bgpd/bgp_route.c
* bgp_announce_check(): Use aggregate attribute when announcing multipath
route
* bgp_announce_check_rsclient(): Use aggregate attribute when announcing
multipath route
* bgp_best_selection(): After updating multipath set, update the
multipath aggregate attribute
diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
index 8d5fa74..244ffd1 100644
--- a/bgpd/bgp_ecommunity.c
+++ b/bgpd/bgp_ecommunity.c
@@ -98,7 +98,7 @@
/* This function takes pointer to Extended Communites strucutre then
create a new Extended Communities structure by uniq and sort each
Extended Communities value. */
-static struct ecommunity *
+struct ecommunity *
ecommunity_uniq_sort (struct ecommunity *ecom)
{
int i;