summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2020-09-24 20:05:32 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2020-09-24 20:05:32 +0200
commit3704ff5608a9624a92c02dcae437f4c7d05da347 (patch)
treeb553ef156c9d0e64f4e1dc700dbf2f956923c111 /ripngd
parentMerge pull request #7164 from AnuradhaKaruppiah/mh-misc-fixes (diff)
downloadfrr-3704ff5608a9624a92c02dcae437f4c7d05da347.tar.xz
frr-3704ff5608a9624a92c02dcae437f4c7d05da347.zip
*: move all userdata when changing node xpath
The same thing was done for interfaces in commit f7c20aa1f. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripngd.c7
1 files changed, 7 insertions, 0 deletions
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++;
}
}