]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: fix filter extended address assignment
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 25 Aug 2020 12:09:05 +0000 (09:09 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 25 Aug 2020 13:35:46 +0000 (10:35 -0300)
`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>
lib/filter_cli.c

index 95637de71e511b32c21c4bb85c5fd20387e76c58..be9de71a287db4abdbf29a9824b3cf9fcd636ef0 100644 (file)
@@ -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);