zebra: pass ERR_STR_SZ in zebra_vxlan_process_vrf_vni_cmd

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
This commit is contained in:
mitesh 2017-12-13 15:20:34 -08:00 committed by Mitesh Kanjariya
parent c05a738b31
commit 3f02fbab67
3 changed files with 9 additions and 8 deletions

View File

@ -1913,7 +1913,7 @@ DEFUN (vrf_vni_mapping,
assert(vrf); assert(vrf);
assert(zvrf); assert(zvrf);
ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, 1); ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 1);
if (ret != 0) { if (ret != 0) {
vty_out(vty, "%s\n", err); vty_out(vty, "%s\n", err);
return CMD_WARNING; return CMD_WARNING;
@ -1938,7 +1938,7 @@ DEFUN (no_vrf_vni_mapping,
assert(vrf); assert(vrf);
assert(zvrf); assert(zvrf);
ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, 0); ret = zebra_vxlan_process_vrf_vni_cmd(zvrf, vni, err, ERR_STR_SZ, 0);
if (ret != 0) { if (ret != 0) {
vty_out(vty, "%s\n", err); vty_out(vty, "%s\n", err);
return CMD_WARNING; return CMD_WARNING;

View File

@ -6293,7 +6293,8 @@ int zebra_vxlan_if_add(struct interface *ifp)
} }
int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf, int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf,
vni_t vni, char *err, vni_t vni,
char *err, int err_str_sz,
int add) int add)
{ {
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
@ -6315,7 +6316,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf,
/* check if the vni is already present under zvrf */ /* check if the vni is already present under zvrf */
if (zvrf->l3vni) { if (zvrf->l3vni) {
snprintf(err, ERR_STR_SZ, snprintf(err, err_str_sz,
"VNI is already configured under the vrf"); "VNI is already configured under the vrf");
return -1; return -1;
} }
@ -6323,7 +6324,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf,
/* check if this VNI is already present in the system */ /* check if this VNI is already present in the system */
zl3vni = zl3vni_lookup(vni); zl3vni = zl3vni_lookup(vni);
if (zl3vni) { if (zl3vni) {
snprintf(err, ERR_STR_SZ, snprintf(err, err_str_sz,
"VNI is already configured as L3-VNI"); "VNI is already configured as L3-VNI");
return -1; return -1;
} }
@ -6331,7 +6332,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf,
/* add the L3-VNI to the global table */ /* add the L3-VNI to the global table */
zl3vni = zl3vni_add(vni, zvrf_id(zvrf)); zl3vni = zl3vni_add(vni, zvrf_id(zvrf));
if (!zl3vni) { if (!zl3vni) {
snprintf(err, ERR_STR_SZ, snprintf(err, err_str_sz,
"Could not add L3-VNI"); "Could not add L3-VNI");
return -1; return -1;
} }
@ -6358,7 +6359,7 @@ int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf *zvrf,
} else { } else {
zl3vni = zl3vni_lookup(vni); zl3vni = zl3vni_lookup(vni);
if (!zl3vni) { if (!zl3vni) {
snprintf(err, ERR_STR_SZ, "VNI doesn't exist"); snprintf(err, err_str_sz, "VNI doesn't exist");
return -1; return -1;
} }

View File

@ -145,7 +145,7 @@ extern int zebra_vxlan_advertise_all_vni(struct zserv *client,
u_short length, u_short length,
struct zebra_vrf *zvrf); struct zebra_vrf *zvrf);
extern int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf*, vni_t, char*, extern int zebra_vxlan_process_vrf_vni_cmd(struct zebra_vrf*, vni_t, char*,
int); int, int);
extern void zebra_vxlan_init_tables(struct zebra_vrf *zvrf); extern void zebra_vxlan_init_tables(struct zebra_vrf *zvrf);
extern void zebra_vxlan_close_tables(struct zebra_vrf *); extern void zebra_vxlan_close_tables(struct zebra_vrf *);
extern void zebra_vxlan_ns_init(struct zebra_ns *zns); extern void zebra_vxlan_ns_init(struct zebra_ns *zns);