From 41a8b88ce4016e56cdf25bdfe094b6fd85d70036 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Wed, 18 May 2022 21:55:33 -0400 Subject: [PATCH] zebra: move the check for l3vni The two checks for l3vni have been already done in `lib_vrf_zebra_l3vni_id_modify()` as it should be. And it is improper that the two checks are put after `zebra_vxlan_handle_vni_transition()`, which will do real things. My original fix is to remove them. But NB module can't guarantee many changes, so we'd better keep them in `zebra_vxlan_process_vrf_vni_cmd()` in APPLY stage for safe. Just move them in front of `zebra_vxlan_handle_vni_transition()`. Signed-off-by: anlan_cs --- zebra/zebra_vxlan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 927df14fbe..4cf309f7fc 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -5273,10 +5273,6 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni, add ? "ADD" : "DEL"); if (add) { - - /* Remove L2VNI if present */ - zebra_vxlan_handle_vni_transition(zvrf, vni, add); - /* check if the vni is already present under zvrf */ if (zvrf->l3vni) { snprintf(err, err_str_sz, @@ -5292,6 +5288,9 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, vni_t vni, return -1; } + /* Remove L2VNI if present */ + zebra_vxlan_handle_vni_transition(zvrf, vni, add); + /* add the L3-VNI to the global table */ zl3vni = zl3vni_add(vni, zvrf_id(zvrf)); -- 2.39.5