summaryrefslogtreecommitdiff
path: root/zebra/zebra_vxlan.c
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2022-05-18 21:55:33 -0400
committeranlan_cs <vic.lan@pica8.com>2022-06-23 01:33:45 -0400
commit41a8b88ce4016e56cdf25bdfe094b6fd85d70036 (patch)
treef033d7a6bd65815eba9ffc461e2b125042031b9f /zebra/zebra_vxlan.c
parent2d088d8d535de7ef084b4583cdfda4b48a324a62 (diff)
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 <vic.lan@pica8.com>
Diffstat (limited to 'zebra/zebra_vxlan.c')
-rw-r--r--zebra/zebra_vxlan.c7
1 files 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));