]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Return duplicate ipv6 prefix-list entry test 18565/head
authorDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 2 Apr 2025 08:09:59 +0000 (11:09 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 2 Apr 2025 19:09:11 +0000 (19:09 +0000)
Fixes: 8384d41144496019725c1e250abd0ceea854341f ("lib: Return duplicate prefix-list entry test")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 24ae7cd30a055dc17fc9d75762320e1359e005b2)

lib/filter_cli.c

index c40c2a75fed5c7e6a548f90dcdf7437bf41f52e8..b6324b3dd1cfe878a3fe0f13079de59054d9b61a 100644 (file)
@@ -1396,10 +1396,14 @@ DEFPY_YANG(
        snprintf(xpath, sizeof(xpath),
                 "/frr-filter:lib/prefix-list[type='ipv6'][name='%s']", name);
        if (seq_str == NULL) {
-               /* Use XPath to find the next sequence number. */
-               sseq = acl_get_seq(vty, xpath, false);
-               if (sseq < 0)
-                       return CMD_WARNING_CONFIG_FAILED;
+               if (plist_is_dup(vty->candidate_config->dnode, &pda))
+                       sseq = pda.pda_seq;
+               else {
+                       /* Use XPath to find the next sequence number. */
+                       sseq = acl_get_seq(vty, xpath, false);
+                       if (sseq < 0)
+                               return CMD_WARNING_CONFIG_FAILED;
+               }
 
                snprintfrr(xpath_entry, sizeof(xpath_entry),
                           "%s/entry[sequence='%" PRId64 "']", xpath, sseq);