From fb912e09004fde46ad4447c6d563b195ee159088 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Sun, 10 Mar 2024 17:35:21 +0200 Subject: lib: fix initialization of northbound nodes When actions and notification are defined as descendants of other nodes, they are not getting initialized, because the iterator skips them. Fix the iterator to include them when traversing the schema. Signed-off-by: Igor Ryzhov --- lib/yang.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/yang.c') diff --git a/lib/yang.c b/lib/yang.c index 03044fc29..d71cb2f49 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -199,6 +199,16 @@ next: if (ret == YANG_ITER_STOP) return ret; } + LY_LIST_FOR ((const struct lysc_node *)lysc_node_notifs(snode), child) { + ret = yang_snodes_iterate_subtree(child, module, cb, flags, arg); + if (ret == YANG_ITER_STOP) + return ret; + } + LY_LIST_FOR ((const struct lysc_node *)lysc_node_actions(snode), child) { + ret = yang_snodes_iterate_subtree(child, module, cb, flags, arg); + if (ret == YANG_ITER_STOP) + return ret; + } return ret; } -- cgit v1.2.3