diff options
| author | Chirag Shah <chirag@nvidia.com> | 2021-11-02 17:57:07 -0700 |
|---|---|---|
| committer | Chirag Shah <chirag@nvidia.com> | 2021-11-08 09:33:16 -0800 |
| commit | b13f35ec6772ae3a2bcff78c9b4ff388278685b3 (patch) | |
| tree | 5f0743a230733a7bda7077723c8f11276abb5c4d /zebra/zebra_vxlan.c | |
| parent | 2d5b7a5b46272de149c93dc70778bce19e67b01d (diff) | |
zebra: svi down remove l2vni from l3vni list
Problem:
L2-VNI SVI down followed by L2-VNI's vxlan device
deletion leads to stale entry into L3VNI's
L2-VNI list.
Solution:
When L2-VNI associated SVI is down, default vrf
is the new tenant vrf.
Remove L2-VNI from L3VNI's l2vni list as
L3VNI/VRF is no longer valid in absence of associated
SVI.
When SVI is up re-add L2-VNI into associated VRF's
L3VNI.
The above remove/add from the L3VNI's L2VNI list is
already done when vxlan or L2-VNI is flaped, just need
to handle when SVI is flapped.
Ticket:#2817127
Reviewed By:
Testing Done:
After deleting SVI following by L2-VNI deletion,
L3VNI's L2-VNI list delets the L2-VNI. (no stale entry).
After adding back SVI/L2-VNI, L3VNI list adds back the
L2-VNI and it is associated right tenant VRF.
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
| -rw-r--r-- | zebra/zebra_vxlan.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index bb46a1e62e..2d2c0a0bee 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -4645,6 +4645,11 @@ int zebra_vxlan_svi_down(struct interface *ifp, struct interface *link_if) zevpn = zebra_evpn_from_svi(ifp, link_if); if (zevpn) { + /* remove from l3-vni list */ + zl3vni = zl3vni_from_vrf(zevpn->vrf_id); + if (zl3vni) + listnode_delete(zl3vni->l2vnis, zevpn); + zevpn->svi_if = NULL; zevpn->vrf_id = VRF_DEFAULT; @@ -4704,6 +4709,10 @@ int zebra_vxlan_svi_up(struct interface *ifp, struct interface *link_if) zevpn->svi_if = ifp; zevpn->vrf_id = ifp->vrf_id; + zl3vni = zl3vni_from_vrf(zevpn->vrf_id); + if (zl3vni) + listnode_add_sort_nodup(zl3vni->l2vnis, zevpn); + if (if_is_operative(zevpn->vxlan_if)) zebra_evpn_send_add_to_client(zevpn); |
