From 60aee1b437ed6812aa8d5c3b459edfd9dd4c8820 Mon Sep 17 00:00:00 2001 From: Graeme Campbell Date: Wed, 13 Sep 2023 09:43:51 +1200 Subject: [PATCH] Add support for netconf subtree leaf-list queries Currently a netconf subtree filter request for a leaf list results in a crash. This change adds support for leaf-list queries. --- schema.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/schema.c b/schema.c index da321a0..be3c1e1 100644 --- a/schema.c +++ b/schema.c @@ -2897,7 +2897,16 @@ _sch_xml_to_gnode (_sch_xml_to_gnode_parms *_parms, sch_node * schema, xmlNs *ns } /* LIST */ - if (sch_is_list (schema)) + if (sch_is_leaf_list (schema)) + { + DEBUG (_parms->in_flags, "%*s%s%s\n", depth * 2, " ", depth ? "" : "/", name); + tree = APTERYX_NODE (NULL, g_strdup (name)); + node = APTERYX_NODE (tree, g_strdup ("*")); + schema = sch_node_child_first (schema); + if (rschema) + *rschema = schema; + } + else if (sch_is_list (schema)) { char *old_xpath = new_xpath; char *key_value;