mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 23:53:28 +00:00
lib: fix deletion of empty prefix-lists
We delete the prefix-list when its last entry is deleted, but the check is missed when we delete the description. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
a0145975e3
commit
ad2b07055c
@ -1462,13 +1462,18 @@ DEFPY_YANG(
|
||||
ACCESS_LIST_REMARK_STR)
|
||||
{
|
||||
char xpath[XPATH_MAXLEN];
|
||||
int rv;
|
||||
|
||||
snprintf(xpath, sizeof(xpath),
|
||||
"/frr-filter:lib/prefix-list[type='ipv4'][name='%s']/remark",
|
||||
name);
|
||||
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
||||
|
||||
return nb_cli_apply_changes(vty, NULL);
|
||||
rv = nb_cli_apply_changes(vty, NULL);
|
||||
if (rv == CMD_SUCCESS)
|
||||
return plist_remove_if_empty(vty, "ipv4", name);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
ALIAS(
|
||||
@ -1658,13 +1663,18 @@ DEFPY_YANG(
|
||||
ACCESS_LIST_REMARK_STR)
|
||||
{
|
||||
char xpath[XPATH_MAXLEN];
|
||||
int rv;
|
||||
|
||||
snprintf(xpath, sizeof(xpath),
|
||||
"/frr-filter:lib/prefix-list[type='ipv6'][name='%s']/remark",
|
||||
name);
|
||||
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
|
||||
|
||||
return nb_cli_apply_changes(vty, NULL);
|
||||
rv = nb_cli_apply_changes(vty, NULL);
|
||||
if (rv == CMD_SUCCESS)
|
||||
return plist_remove_if_empty(vty, "ipv6", name);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
ALIAS(
|
||||
|
Loading…
Reference in New Issue
Block a user