data tree BUGFIX handle insert sibling matching params
@@ -2016,6 +2016,11 @@ lyd_insert_sibling(struct lyd_node *sibling, struct lyd_node *node, struct lyd_n
LY_CHECK_RET(lyd_insert_check_schema(lysc_data_parent(sibling->schema), node->schema));
}
+ if (sibling == node) {
+ /* we need to keep the connection to siblings so we can insert into them */
+ sibling = sibling->prev;
+ }
+
if (node->parent || node->prev->next) {
lyd_unlink_tree(node);
}
