diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2022-08-30 18:13:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-30 18:13:02 +0300 |
| commit | 40e65d74b6f07c901ae8225aa7efb2ccf66c264a (patch) | |
| tree | 6d45e61f5a83f3894567a1104b7ba33a938f781d | |
| parent | 464ae6a6540d5f664431990c4d502b15b2a8c0ff (diff) | |
| parent | df78d91d8aab3bdb5b7fc8db6c451aa1d9be7b78 (diff) | |
Merge pull request #11866 from anlancs/fix/evpn-l2vni
zebra: fix missing vni transition
| -rw-r--r-- | zebra/zebra_vxlan.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 5a6321ae7e..9fae556dd4 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -2090,6 +2090,7 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni, int add) { struct zebra_evpn *zevpn = NULL; + struct zebra_l3vni *zl3vni = NULL; /* There is a possibility that VNI notification was already received * from kernel and we programmed it as L2-VNI @@ -2117,6 +2118,10 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni, /* Free up all remote VTEPs, if any. */ zebra_evpn_vtep_del_all(zevpn, 1); + zl3vni = zl3vni_from_vrf(zevpn->vrf_id); + if (zl3vni) + listnode_delete(zl3vni->l2vnis, zevpn); + /* Delete the hash entry. */ if (zebra_evpn_vxlan_del(zevpn)) { flog_err(EC_ZEBRA_VNI_DEL_FAILED, @@ -2172,8 +2177,12 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni, /* Find bridge interface for the VNI */ vlan_if = zvni_map_to_svi(vxl->access_vlan, zif->brslave_info.br_if); - if (vlan_if) + if (vlan_if) { zevpn->vrf_id = vlan_if->vrf->vrf_id; + zl3vni = zl3vni_from_vrf(vlan_if->vrf->vrf_id); + if (zl3vni) + listnode_add_sort_nodup(zl3vni->l2vnis, zevpn); + } zevpn->vxlan_if = ifp; zevpn->local_vtep_ip = vxl->vtep_ip; |
