mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 07:37:54 +00:00
bgpd: fix evpn ecommunity auto rts
Evpn extended communities like auto rts (import/export) should check if its present in list before adding it, to avoid duplicate addition. L3vni_add callback from zebra to bgp may see updates to vnis. The auto import/export rt derivation may call multiple times. Testing Done: Before: TORC11# show bgp l2vpn evpn vni 4001 VNI: 4001 (known to the kernel) Type: L3 Tenant VRF: vrf1 RD: 45.0.2.2:3 ... Import Route Target: 5546:4001 5546:4001 Export Route Target: 5546:4001 5546:4001 After: VNI: 4001 (known to the kernel) Type: L3 Tenant VRF: vrf1 RD: 45.0.2.2:3 ... Import Route Target: 5546:4001 Export Route Target: 5546:4001 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
This commit is contained in:
parent
dd7c916952
commit
b90d4580f0
@ -505,7 +505,9 @@ static void unmap_vni_from_rt(struct bgp *bgp, struct bgpevpn *vpn,
|
||||
static void form_auto_rt(struct bgp *bgp, vni_t vni, struct list *rtl)
|
||||
{
|
||||
struct ecommunity_val eval;
|
||||
struct ecommunity *ecomadd;
|
||||
struct ecommunity *ecomadd, *ecom;
|
||||
bool ecom_found = false;
|
||||
struct listnode *node;
|
||||
|
||||
if (bgp->advertise_autort_rfc8365)
|
||||
vni |= EVPN_AUTORT_VXLAN;
|
||||
@ -513,7 +515,12 @@ static void form_auto_rt(struct bgp *bgp, vni_t vni, struct list *rtl)
|
||||
|
||||
ecomadd = ecommunity_new();
|
||||
ecommunity_add_val(ecomadd, &eval);
|
||||
listnode_add_sort(rtl, ecomadd);
|
||||
for (ALL_LIST_ELEMENTS_RO(rtl, node, ecom))
|
||||
if (ecommunity_cmp(ecomadd, ecom))
|
||||
ecom_found = true;
|
||||
|
||||
if (!ecom_found)
|
||||
listnode_add_sort(rtl, ecomadd);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user