libyang
libyang copied to clipboard
lyd_diff_tree "escapes" to siblings
.. when called without flag LYD_DIFF_DEFAULTS on node having LYD_DEFAULT or when called on opaque node.
Root cause: nosiblings is checked only when node comparison completed but it not happens on opaque or LYD_DEFAULT nodes.
Workaround: modify application to not call lyd_diff_tree in such cases. But may be it makes sense to check nosiblings and break instead of continue there ?
Changing this for opaque nodes may be okay. But for default nodes it would likely break many use-cases, one often does not even know that there are some default nodes (NP containers) so it could seem that no nodes were traversed at all.