From 3704ff5608a9624a92c02dcae437f4c7d05da347 Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Thu, 24 Sep 2020 21:05:32 +0300 Subject: *: move all userdata when changing node xpath The same thing was done for interfaces in commit f7c20aa1f. Signed-off-by: Igor Ryzhov --- ripngd/ripngd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ripngd') diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index bf6c6ff27..8a7950daf 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2791,13 +2791,20 @@ static int ripng_vrf_enable(struct vrf *vrf) */ if (yang_module_find("frr-ripngd") && old_vrf_name) { struct lyd_node *ripng_dnode; + char oldpath[XPATH_MAXLEN]; + char newpath[XPATH_MAXLEN]; ripng_dnode = yang_dnode_get( running_config->dnode, "/frr-ripngd:ripngd/instance[vrf='%s']/vrf", old_vrf_name); if (ripng_dnode) { + yang_dnode_get_path(ripng_dnode->parent, oldpath, + sizeof(oldpath)); yang_dnode_change_leaf(ripng_dnode, vrf->name); + yang_dnode_get_path(ripng_dnode->parent, newpath, + sizeof(newpath)); + nb_running_move_tree(oldpath, newpath); running_config->version++; } } -- cgit v1.2.3