diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-08-25 09:09:05 -0300 |
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-08-25 10:35:46 -0300 |
| commit | 4859a57e11db58977eafaa28fcaea9f32375546c (patch) | |
| tree | 8345b25786d3556cb03d16465557c1ae21114344 | |
| parent | 59ed102f963982b306b33581f99693adb5f74646 (diff) | |
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 <rzalamena@opensourcerouting.org>
| -rw-r--r-- | lib/filter_cli.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |
