summaryrefslogtreecommitdiff
path: root/lib/northbound_sysrepo.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2020-10-26 13:14:30 -0400
committerGitHub <noreply@github.com>2020-10-26 13:14:30 -0400
commit0616c6589f5bb0a9e5ffe31d9119de953881a26e (patch)
tree24175066e3d00a77bd418d04bf550ab6d5caaa74 /lib/northbound_sysrepo.c
parent070a7cd8bd71b8fde4d8d0b2b6d4e24dd5a4bb7b (diff)
parent59e85ca1baa61757b6d857d5559aa5a196e96ede (diff)
Merge pull request #7384 from opensourcerouting/nb-dyn-modules
lib: add API to load YANG modules on demand
Diffstat (limited to 'lib/northbound_sysrepo.c')
-rw-r--r--lib/northbound_sysrepo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 3cd310c5a7..c027f4de72 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -575,6 +575,8 @@ static int frr_sr_subscribe_state(const struct lys_node *snode, void *arg)
return YANG_ITER_CONTINUE;
nb_node = snode->priv;
+ if (!nb_node)
+ return YANG_ITER_CONTINUE;
DEBUGD(&nb_dbg_client_sysrepo, "sysrepo: providing data to '%s'",
nb_node->xpath);
@@ -599,6 +601,8 @@ static int frr_sr_subscribe_rpc(const struct lys_node *snode, void *arg)
return YANG_ITER_CONTINUE;
nb_node = snode->priv;
+ if (!nb_node)
+ return YANG_ITER_CONTINUE;
DEBUGD(&nb_dbg_client_sysrepo, "sysrepo: providing RPC to '%s'",
nb_node->xpath);
@@ -686,10 +690,10 @@ static int frr_sr_init(void)
int event_pipe;
frr_sr_subscribe_config(module);
- yang_snodes_iterate_module(module->info, frr_sr_subscribe_state,
- 0, module);
- yang_snodes_iterate_module(module->info, frr_sr_subscribe_rpc,
- 0, module);
+ yang_snodes_iterate(module->info, frr_sr_subscribe_state, 0,
+ module);
+ yang_snodes_iterate(module->info, frr_sr_subscribe_rpc, 0,
+ module);
/* Watch subscriptions. */
ret = sr_get_event_pipe(module->sr_subscription, &event_pipe);