summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorChristian Hopps <chopps@gmail.com>2021-05-04 16:41:58 +0200
committerChristian Hopps <chopps@labn.net>2021-05-13 22:24:48 +0200
commit3bb513c399c2e7c8dd597b7399dd7c0f064842d0 (patch)
tree14f3e677c49fce272946788f8a8b8f3f8a3e26b5 /ripngd
parentMerge pull request #8629 from donaldsharp/parse_rtattr (diff)
downloadfrr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.tar.xz
frr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.zip
lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripng_interface.c2
-rw-r--r--ripngd/ripngd.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index 11a8fdff8..c4d494804 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -933,7 +933,7 @@ static int interface_config_write(struct vty *vty)
FOR_ALL_INTERFACES (vrf, ifp) {
struct lyd_node *dnode;
- dnode = yang_dnode_get(
+ dnode = yang_dnode_getf(
running_config->dnode,
"/frr-interface:lib/interface[name='%s'][vrf='%s']",
ifp->name, vrf->name);
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 5a71928fb..3b8d2076f 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2634,16 +2634,16 @@ static int ripng_vrf_enable(struct vrf *vrf)
char oldpath[XPATH_MAXLEN];
char newpath[XPATH_MAXLEN];
- ripng_dnode = yang_dnode_get(
+ ripng_dnode = yang_dnode_getf(
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_get_path(lyd_parent(ripng_dnode),
+ oldpath, sizeof(oldpath));
yang_dnode_change_leaf(ripng_dnode, vrf->name);
- yang_dnode_get_path(ripng_dnode->parent, newpath,
- sizeof(newpath));
+ yang_dnode_get_path(lyd_parent(ripng_dnode),
+ newpath, sizeof(newpath));
nb_running_move_tree(oldpath, newpath);
running_config->version++;
}