forked from Mirror/frr
lib: fix yang_dnode_dup
When duplicating nodes, we should always keep flags, especially the LYD_NEW flag that indicates not validated data. This allows to select a new choice's case without the need to explicitly remove the existing one. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
741d1d0090
commit
fe76036002
|
@ -628,7 +628,8 @@ struct lyd_node *yang_dnode_dup(const struct lyd_node *dnode)
|
|||
{
|
||||
struct lyd_node *dup = NULL;
|
||||
LY_ERR err;
|
||||
err = lyd_dup_siblings(dnode, NULL, LYD_DUP_RECURSIVE, &dup);
|
||||
err = lyd_dup_siblings(dnode, NULL,
|
||||
LYD_DUP_RECURSIVE | LYD_DUP_WITH_FLAGS, &dup);
|
||||
assert(!err);
|
||||
return dup;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue