summaryrefslogtreecommitdiff
path: root/zebra/zebra_nb_rpcs.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2020-10-03 16:12:31 -0700
committerChirag Shah <chirag@nvidia.com>2020-10-05 13:57:54 -0700
commit9bee02322f69e34c54510f8dff245e52794fdfc8 (patch)
tree13d272969c3abf5a94b472fb9312a186df339b1b /zebra/zebra_nb_rpcs.c
parentf63f5f1947c3b4a99e97494198520f03fb6b063e (diff)
zebra: display rpc error msg to vtysh
Zebra's clear duplicate detect command is rpc converted. There is condition where cli fails with human readable message. Using northboun's errmsg buffer to display error message to user. Testing: bharat# clear evpn dup-addr vni 1002 ip 2011:11::11 Error type: generic error Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state bharat# clear evpn dup-addr vni 1002 ip 11.11.11.11 Error type: generic error Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'zebra/zebra_nb_rpcs.c')
-rw-r--r--zebra/zebra_nb_rpcs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/zebra/zebra_nb_rpcs.c b/zebra/zebra_nb_rpcs.c
index 204cc5da6d..e7d438b1af 100644
--- a/zebra/zebra_nb_rpcs.c
+++ b/zebra/zebra_nb_rpcs.c
@@ -65,19 +65,22 @@ int clear_evpn_dup_addr_rpc(struct nb_cb_rpc_args *args)
if (yang_dup_mac) {
yang_str2mac(yang_dup_mac->value, &mac);
ret = zebra_vxlan_clear_dup_detect_vni_mac(
- zvrf, vni, &mac);
+ zvrf, vni, &mac, args->errmsg,
+ args->errmsg_len);
} else if (yang_dup_ip) {
yang_str2ip(yang_dup_ip->value, &host_ip);
ret = zebra_vxlan_clear_dup_detect_vni_ip(
- zvrf, vni, &host_ip);
+ zvrf, vni, &host_ip, args->errmsg,
+ args->errmsg_len);
} else
ret = zebra_vxlan_clear_dup_detect_vni(zvrf,
vni);
}
}
- ret = (ret != CMD_SUCCESS) ? NB_ERR : NB_OK;
+ if (ret < 0)
+ return NB_ERR;
- return ret;
+ return NB_OK;
}
/*