summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-06-25 07:07:17 +0200
committerGitHub <noreply@github.com>2024-06-25 07:07:17 +0200
commit67421ba30dde68638906212457f9b71036399067 (patch)
treed05264a6bd5f362a7cfd471eae3276aeb6948e6b /zebra
parentMerge pull request #16267 from louis-6wind/fix-isis-srv6-json (diff)
parentzebra: clear evpn dup-addr return error-msg when there is no vni (diff)
downloadfrr-67421ba30dde68638906212457f9b71036399067.tar.xz
frr-67421ba30dde68638906212457f9b71036399067.zip
Merge pull request #16261 from chiragshah6/evpn_dev4
zebra: clear evpn dup-addr return error-msg when there is no vni
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_nb_rpcs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/zebra/zebra_nb_rpcs.c b/zebra/zebra_nb_rpcs.c
index 938193df2..744ba620f 100644
--- a/zebra/zebra_nb_rpcs.c
+++ b/zebra/zebra_nb_rpcs.c
@@ -12,6 +12,8 @@
#include "zebra/zebra_router.h"
#include "zebra/zebra_vrf.h"
#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_vxlan_if.h"
+#include "zebra/zebra_evpn.h"
/*
* XPath: /frr-zebra:clear-evpn-dup-addr
@@ -21,6 +23,11 @@ int clear_evpn_dup_addr_rpc(struct nb_cb_rpc_args *args)
struct zebra_vrf *zvrf;
int ret = NB_OK;
+ if (!is_evpn_enabled()) {
+ snprintf(args->errmsg, args->errmsg_len,
+ "%% EVPN not enabled\n");
+ return NB_ERR_VALIDATION;
+ }
zvrf = zebra_vrf_get_evpn();
if (yang_dnode_exists(args->input, "all-vnis")) {
@@ -30,6 +37,12 @@ int clear_evpn_dup_addr_rpc(struct nb_cb_rpc_args *args)
struct ipaddr host_ip = {.ipa_type = IPADDR_NONE};
struct ethaddr mac;
+ if (!zebra_evpn_lookup(vni)) {
+ snprintf(args->errmsg, args->errmsg_len,
+ "%% VNI %u does not exist\n", vni);
+ return NB_ERR_VALIDATION;
+ }
+
if (yang_dnode_exists(args->input, "mac-addr")) {
yang_dnode_get_mac(&mac, args->input, "mac-addr");
ret = zebra_vxlan_clear_dup_detect_vni_mac(zvrf, vni,