mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 09:30:30 +00:00
bgpd: Allow generating EVPN type-5 routes with existing extended community
The EVPN advertise route-map may generate extended communities for an IPv4 or IPv6 route injected into EVPN as type-5. If so, allow for it and add to it. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
ae0eaca5ce
commit
fab92da7ca
@ -744,6 +744,7 @@ static void build_evpn_type5_route_extcomm(struct bgp *bgp_vrf,
|
|||||||
bgp_encap_types tnl_type;
|
bgp_encap_types tnl_type;
|
||||||
struct listnode *node, *nnode;
|
struct listnode *node, *nnode;
|
||||||
struct ecommunity *ecom;
|
struct ecommunity *ecom;
|
||||||
|
struct ecommunity *old_ecom;
|
||||||
struct list *vrf_export_rtl = NULL;
|
struct list *vrf_export_rtl = NULL;
|
||||||
|
|
||||||
/* Encap */
|
/* Encap */
|
||||||
@ -754,7 +755,14 @@ static void build_evpn_type5_route_extcomm(struct bgp *bgp_vrf,
|
|||||||
ecom_encap.val = (uint8_t *)eval.val;
|
ecom_encap.val = (uint8_t *)eval.val;
|
||||||
|
|
||||||
/* Add Encap */
|
/* Add Encap */
|
||||||
attr->ecommunity = ecommunity_dup(&ecom_encap);
|
if (attr->ecommunity) {
|
||||||
|
old_ecom = attr->ecommunity;
|
||||||
|
ecom = ecommunity_merge(ecommunity_dup(old_ecom), &ecom_encap);
|
||||||
|
if (!old_ecom->refcnt)
|
||||||
|
ecommunity_free(&old_ecom);
|
||||||
|
} else
|
||||||
|
ecom = ecommunity_dup(&ecom_encap);
|
||||||
|
attr->ecommunity = ecom;
|
||||||
|
|
||||||
/* Add the export RTs for L3VNI/VRF */
|
/* Add the export RTs for L3VNI/VRF */
|
||||||
vrf_export_rtl = bgp_vrf->vrf_export_rtl;
|
vrf_export_rtl = bgp_vrf->vrf_export_rtl;
|
||||||
|
Loading…
Reference in New Issue
Block a user