Skip to content

lyd_merge deleted rpc's child when then source output should be insert before the target #697

@mrdotchenke

Description

@mrdotchenke

The test module is like this:

  module test {
    namespace "urn:test:yang:test";
    prefix tst;
    revision 2019-01-01;
    rpc test {
      output {
        container a {
          leaf x {
            type string;
          }
        }
        container b {
          leaf y {
            type string;
          }
        }
      }
    }
  }

Then build two subtrees by lyd_new_path:

lyd_node* first = lyd_new_path(NULL, ctx, "/test:test/b/y", NULL, 0, LYD_PATH_OPT_OUTPUT);
lyd_node* second = lyd_new_path(NULL, ctx, "/test:test/a/x", NULL, 0, LYD_PATH_OPT_OUTPUT);

When using lyd_merge function to merge the second one into the first one:

lyd_merge(first, second, 0);

The return was success but the first->child was NULL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions