Skip to content

Commit

Permalink
Merge pull request #16569 from FRRouting/mergify/bp/stable/10.0/pr-16551
Browse files Browse the repository at this point in the history
lib: fix distribute-list deletion (backport #16551)
  • Loading branch information
donaldsharp authored Aug 13, 2024
2 parents 6621d83 + 51c43a8 commit 8d70c35
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/distribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,43 @@ int group_distribute_list_create_helper(
* XPath: /frr-ripd:ripd/instance/distribute-lists/distribute-list/{in,out}/{access,prefix}-list
*/

static int distribute_list_leaf_update(const struct lyd_node *dnode,
int ip_version, bool no);

int group_distribute_list_destroy(struct nb_cb_destroy_args *args)
{
struct lyd_node *dnode;

if (args->event != NB_EV_APPLY)
return NB_OK;

/*
* We don't keep the IP version of distribute-list anywhere, so we're
* trying to remove both. If one doesn't exist, it's simply skipped by
* the remove function.
*/

dnode = yang_dnode_get(args->dnode, "in/access-list");
if (dnode) {
distribute_list_leaf_update(dnode, 4, true);
distribute_list_leaf_update(dnode, 6, true);
}
dnode = yang_dnode_get(args->dnode, "in/prefix-list");
if (dnode) {
distribute_list_leaf_update(dnode, 4, true);
distribute_list_leaf_update(dnode, 6, true);
}
dnode = yang_dnode_get(args->dnode, "out/access-list");
if (dnode) {
distribute_list_leaf_update(dnode, 4, true);
distribute_list_leaf_update(dnode, 6, true);
}
dnode = yang_dnode_get(args->dnode, "out/prefix-list");
if (dnode) {
distribute_list_leaf_update(dnode, 4, true);
distribute_list_leaf_update(dnode, 6, true);
}

nb_running_unset_entry(args->dnode);
return NB_OK;
}
Expand Down

0 comments on commit 8d70c35

Please sign in to comment.