]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Adjust only `any` flag for prefix-list entries if destroying
authorDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 17 Mar 2023 12:48:35 +0000 (14:48 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 17 Mar 2023 12:54:39 +0000 (14:54 +0200)
Before this patch, if we destroy `any` flag for a prefix-list entry, we always
set destination as 0.0.0.0/0 and/or ::/0.

This means that, if we switch from `ip prefix-list r1-2 seq 5 deny any` to
`ip prefix-list r1-2 seq 5 permit 10.10.10.10/32` we will have
`permit any` eventually, which broke ACLs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
lib/filter_cli.c
lib/filter_nb.c

index 7ef0d47f67bc016e104784d8e021b5c63a80550f..927cf4418e9faffd0f534aea92b4d05a28ef5aee 100644 (file)
@@ -1326,6 +1326,7 @@ DEFPY_YANG(
                                vty, "./ipv4-prefix-length-lesser-or-equal",
                                NB_OP_DESTROY, NULL);
                }
+               nb_cli_enqueue_change(vty, "./any", NB_OP_DESTROY, NULL);
        } else {
                nb_cli_enqueue_change(vty, "./any", NB_OP_CREATE, NULL);
        }
index a14f232339db7719af12ebe9334d847898932068..b5e3e5f65f3a2849d7a57ef7df33ec0159234582 100644 (file)
@@ -1630,7 +1630,7 @@ static int lib_prefix_list_entry_any_destroy(struct nb_cb_destroy_args *args)
        /* Start prefix entry update procedure. */
        prefix_list_entry_update_start(ple);
 
-       prefix_list_entry_set_empty(ple);
+       ple->any = false;
 
        /* Finish prefix entry update procedure. */
        prefix_list_entry_update_finish(ple);