From 4859a57e11db58977eafaa28fcaea9f32375546c Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 25 Aug 2020 09:09:05 -0300 Subject: lib: fix filter extended address assignment `nb_cli_enqueue_change` just points to the string values passed in parameter, so we must use different strings for different function calls (at least until `nb_cli_apply_changes`). While here fix a variable name typo/copy paste error on destination host case. Signed-off-by: Rafael Zalamena --- lib/filter_cli.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/filter_cli.c') diff --git a/lib/filter_cli.c b/lib/filter_cli.c index 95637de71e..be9de71a28 100644 --- a/lib/filter_cli.c +++ b/lib/filter_cli.c @@ -290,7 +290,7 @@ DEFPY_YANG( "Any destination host\n") { int64_t sseq; - char ipmask[64]; + char ipmask[64], ipmask_dst[64]; char xpath[XPATH_MAXLEN]; char xpath_entry[XPATH_MAXLEN + 128]; @@ -325,12 +325,12 @@ DEFPY_YANG( if (dst_str != NULL && dst_mask_str == NULL) { nb_cli_enqueue_change(vty, "./destination-host", NB_OP_MODIFY, - src_str); + dst_str); } else if (dst_str != NULL && dst_mask_str != NULL) { - concat_addr_mask_v4(dst_str, dst_mask_str, ipmask, - sizeof(ipmask)); + concat_addr_mask_v4(dst_str, dst_mask_str, ipmask_dst, + sizeof(ipmask_dst)); nb_cli_enqueue_change(vty, "./destination-network", - NB_OP_MODIFY, ipmask); + NB_OP_MODIFY, ipmask_dst); } else { nb_cli_enqueue_change(vty, "./destination-any", NB_OP_CREATE, NULL); -- cgit v1.2.3