summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-03-14 21:04:37 -0300
committerGitHub <noreply@github.com>2021-03-14 21:04:37 -0300
commit70d453d2a08abdbff7664ae7997426144fb68c37 (patch)
treee09cb3fe9eb786d1b3627b1902f37670ef588149
parente319ed4c49f5c4cc67611727490bde4bc3f2e51e (diff)
parentbaa1d4aff6fc6029e87711e6a55f795300c2461b (diff)
Merge pull request #8160 from idryzhov/fix-show-yang-oper
lib: fix crash when iterating over nb operational data
-rw-r--r--lib/northbound.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index 224951b22b..b6d3518285 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -1817,6 +1817,16 @@ int nb_oper_data_iterate(const char *xpath, struct yang_translator *translator,
/* Find the list entry pointer. */
nn = dn->schema->priv;
+ if (!nn->cbs.lookup_entry) {
+ flog_warn(
+ EC_LIB_NB_OPERATIONAL_DATA,
+ "%s: data path doesn't support iteration over operational data: %s",
+ __func__, xpath);
+ list_delete(&list_dnodes);
+ yang_dnode_free(dnode);
+ return NB_ERR;
+ }
+
list_entry =
nb_callback_lookup_entry(nn, list_entry, &list_keys);
if (list_entry == NULL) {