From: Avneesh Sachdev Date: Mon, 9 Apr 2012 07:25:15 +0000 (-0700) Subject: Merge branch 'quagga' into google-bgp-multipath X-Git-Tag: frr-2.0-rc1~1863^2 X-Git-Url: https://git.proxmox.com/?p=mirror_frr.git;a=commitdiff_plain;h=3cf6c2b4e43f44a977d218c96c26250654ae333e Merge branch 'quagga' into google-bgp-multipath Conflicts: bgpd/bgp_route.c --- 3cf6c2b4e43f44a977d218c96c26250654ae333e diff --cc bgpd/bgp_ecommunity.h index 1a2252709,2f59dc409..92affccca --- a/bgpd/bgp_ecommunity.h +++ b/bgpd/bgp_ecommunity.h @@@ -71,10 -71,9 +71,10 @@@ extern void ecommunity_free (struct eco extern struct ecommunity *ecommunity_parse (u_int8_t *, u_short); extern struct ecommunity *ecommunity_dup (struct ecommunity *); extern struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *); +extern struct ecommunity *ecommunity_uniq_sort (struct ecommunity *); extern struct ecommunity *ecommunity_intern (struct ecommunity *); extern int ecommunity_cmp (const void *, const void *); - extern void ecommunity_unintern (struct ecommunity *); + extern void ecommunity_unintern (struct ecommunity **); extern unsigned int ecommunity_hash_make (void *); extern struct ecommunity *ecommunity_str2com (const char *, int, int); extern char *ecommunity_ecom2str (struct ecommunity *, int); diff --cc bgpd/bgp_route.c index a4923f57b,ba530321a..087f83961 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@@ -138,10 -137,9 +138,10 @@@ static voi bgp_info_free (struct bgp_info *binfo) { if (binfo->attr) - bgp_attr_unintern (binfo->attr); + bgp_attr_unintern (&binfo->attr); bgp_info_extra_free (&binfo->extra); + bgp_info_mpath_free (&binfo->mpath); peer_unlock (binfo->peer); /* bgp_info peer reference */ @@@ -1092,13 -1069,9 +1092,11 @@@ bgp_announce_check_rsclient (struct bgp struct bgp_filter *filter; struct bgp_info info; struct peer *from; - struct bgp *bgp; + struct attr *riattr; from = ri->peer; filter = &rsclient->filter[afi][safi]; - bgp = rsclient->bgp; + riattr = bgp_info_mpath_count (ri) ? bgp_info_mpath_attr (ri) : ri->attr; if (DISABLE_BGP_ANNOUNCE) return 0; @@@ -1566,11 -1490,9 +1564,11 @@@ bgp_process_main (struct work_queue *wq { if (! CHECK_FLAG (old_select->flags, BGP_INFO_ATTR_CHANGED)) { - if (CHECK_FLAG (old_select->flags, BGP_INFO_IGP_CHANGED)) + if (CHECK_FLAG (old_select->flags, BGP_INFO_IGP_CHANGED) || + CHECK_FLAG (old_select->flags, BGP_INFO_MULTIPATH_CHG)) - bgp_zebra_announce (p, old_select, bgp); + bgp_zebra_announce (p, old_select, bgp, safi); + UNSET_FLAG (old_select->flags, BGP_INFO_MULTIPATH_CHG); UNSET_FLAG (rn->flags, BGP_NODE_PROCESS_SCHEDULED); return WQ_SUCCESS; } diff --cc bgpd/bgp_zebra.c index 6c21230a0,20feba0f4..5c0dbb887 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@@ -703,9 -678,10 +706,10 @@@ bgp_zebra_announce (struct prefix *p, s api.type = ZEBRA_ROUTE_BGP; api.message = 0; + api.safi = safi; SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP); - api.nexthop_num = 1; - api.nexthop = &nexthop; + api.nexthop_num = 1 + bgp_info_mpath_count (info); + api.nexthop = (struct in_addr **)STREAM_DATA (bgp_nexthop_buf); api.ifindex_num = 0; SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); api.metric = info->attr->med; diff --cc bgpd/bgp_zebra.h index 461255e39,1351333f7..80991930f --- a/bgpd/bgp_zebra.h +++ b/bgpd/bgp_zebra.h @@@ -21,18 -21,12 +21,18 @@@ Boston, MA 02111-1307, USA. * #ifndef _QUAGGA_BGP_ZEBRA_H #define _QUAGGA_BGP_ZEBRA_H +#define BGP_NEXTHOP_BUF_SIZE (8 * sizeof (struct in_addr *)) + +extern struct stream *bgp_nexthop_buf; + extern void bgp_zebra_init (void); extern int bgp_if_update_all (void); +extern int bgp_config_write_maxpaths (struct vty *, struct bgp *, afi_t, + safi_t, int *); extern int bgp_config_write_redistribute (struct vty *, struct bgp *, afi_t, safi_t, int *); - extern void bgp_zebra_announce (struct prefix *, struct bgp_info *, struct bgp *); - extern void bgp_zebra_withdraw (struct prefix *, struct bgp_info *); + extern void bgp_zebra_announce (struct prefix *, struct bgp_info *, struct bgp *, safi_t); + extern void bgp_zebra_withdraw (struct prefix *, struct bgp_info *, safi_t); extern int bgp_redistribute_set (struct bgp *, afi_t, int); extern int bgp_redistribute_rmap_set (struct bgp *, afi_t, int, const char *);