From 9b5337181682dbd334e664b0a9d3c9b9605397e7 Mon Sep 17 00:00:00 2001 From: Tony van der Peet Date: Wed, 27 Nov 2024 15:19:23 +1300 Subject: [PATCH] Fixes for with-defaults processing In _merge_gnode_nodes, don't continue when the child1 node has no children. This is to allow the recursive call which, while it will have no effect in the loop over node1's children, may have an effect in the loop over node2's children. Change schemas to allow the new tests in apteryx-netconf. The test5 schema is meant to mimic the structure of the interfaces/ethernet/poe models in openconfig. --- models/test.xml | 2 +- models/test5:test5.xml | 32 ++++++++++++++++++++++++++++++++ schema.c | 3 --- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 models/test5:test5.xml diff --git a/models/test.xml b/models/test.xml index 8b751e2..0a52fd8 100644 --- a/models/test.xml +++ b/models/test.xml @@ -107,7 +107,7 @@ Sample REFRESH node - + diff --git a/models/test5:test5.xml b/models/test5:test5.xml new file mode 100644 index 0000000..2e58708 --- /dev/null +++ b/models/test5:test5.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schema.c b/schema.c index 563b814..beee82b 100644 --- a/schema.c +++ b/schema.c @@ -3517,9 +3517,6 @@ _merge_gnode_nodes (GNode *node1, GNode *node2) for (child1 = node1->children; child1; child1 = child1->next) { - if (!child1->children) - continue; - /* Match child1 to a child of node2. If matched descend down the tree. */ for (child2 = node2->children; child2; child2 = child2->next) {