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 <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-03-17 14:48:35 +02:00
parent a1e538178c
commit 61c07b9d43
2 changed files with 2 additions and 1 deletions

View 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);
}

View 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);