diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2021-02-26 17:17:28 +0100 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-02-26 17:17:28 +0100 |
commit | baa1d4aff6fc6029e87711e6a55f795300c2461b (patch) | |
tree | 20be6f9187bb1e92b4c2c2e56a0a9ee527971e61 /lib | |
parent | Merge pull request #8139 from volta-networks/fix_ospf6_show_database (diff) | |
download | frr-baa1d4aff6fc6029e87711e6a55f795300c2461b.tar.xz frr-baa1d4aff6fc6029e87711e6a55f795300c2461b.zip |
lib: fix crash when iterating over nb operational data
Example:
```
show yang operational-data /frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-staticd:staticd'][name='staticd'][vrf='default'] staticd
```
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/northbound.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/northbound.c b/lib/northbound.c index 224951b22..b6d351828 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) { |