From: Donatas Abraitis Date: Fri, 17 Mar 2023 12:48:35 +0000 (+0200) Subject: lib: Adjust only `any` flag for prefix-list entries if destroying X-Git-Tag: frr-8.4.4~48^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F13034%2Fhead;p=mirror%2Ffrr.git lib: Adjust only `any` flag for prefix-list entries if destroying 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 (cherry picked from commit 61c07b9d43529f69f48ca54f4f0213cff52b5d0a) --- diff --git a/lib/filter_cli.c b/lib/filter_cli.c index 9a877a5704..5c31757c2f 100644 --- a/lib/filter_cli.c +++ b/lib/filter_cli.c @@ -1319,6 +1319,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); } diff --git a/lib/filter_nb.c b/lib/filter_nb.c index 3ed1f3e03e..215a33d394 100644 --- a/lib/filter_nb.c +++ b/lib/filter_nb.c @@ -1643,7 +1643,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);