summaryrefslogtreecommitdiff
path: root/lib/keychain_nb.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2025-02-11 07:12:06 +0000
committerChristian Hopps <chopps@labn.net>2025-02-14 18:14:30 +0000
commitd03ecf4562ef3ade6b7b83bf6c683c4741f395ba (patch)
treec98c21a9d07c6168c6702c8d0787a51d9ee77bf7 /lib/keychain_nb.c
parentbaf4c1a78fe4cafdbb2cdbed030a31ea04a18c4a (diff)
lib: nb: call child destroy CBs when YANG container is deleted
Previously the code was only calling the child destroy callbacks if the target deleted node was a non-presence container. We now add a flag to the callback structure to instruct northbound to perform the rescursive delete for code that wishes for this to happen. - Fix wrong relative path lookup in keychain destroy callback Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/keychain_nb.c')
-rw-r--r--lib/keychain_nb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/keychain_nb.c b/lib/keychain_nb.c
index 57967b30a5..7c3df1c857 100644
--- a/lib/keychain_nb.c
+++ b/lib/keychain_nb.c
@@ -587,9 +587,9 @@ static int key_chains_key_chain_key_crypto_algorithm_destroy(
if (args->event != NB_EV_APPLY)
return NB_OK;
- name = yang_dnode_get_string(args->dnode, "../../../name");
+ name = yang_dnode_get_string(args->dnode, "../../name");
keychain = keychain_lookup(name);
- index = (uint32_t)yang_dnode_get_uint64(args->dnode, "../../key-id");
+ index = (uint32_t)yang_dnode_get_uint64(args->dnode, "../key-id");
key = key_lookup(keychain, index);
key->hash_algo = KEYCHAIN_ALGO_NULL;
keychain_touch(keychain);