mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 11:33:48 +00:00
lib: fix harmless lyd_schema_sort() warning
The dnode member of the nb_config structure can be null on
daemons that don't implement any YANG module. As such, update
the nb_cli_show_config_prepare() function to always check if the
libyang data node that is going to be displayed is null or not
before operating on it.
This fixes the following warning (introduced by commit 5e6a9350c1
):
libyang: Invalid arguments (lyd_schema_sort())
Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
890b7a3c77
commit
b83d713426
@ -424,6 +424,10 @@ static struct lyd_node *ly_iter_next_up(const struct lyd_node *elem)
|
||||
/* Prepare the configuration for display. */
|
||||
void nb_cli_show_config_prepare(struct nb_config *config, bool with_defaults)
|
||||
{
|
||||
/* Nothing to do for daemons that don't implement any YANG module. */
|
||||
if (config->dnode == NULL)
|
||||
return;
|
||||
|
||||
lyd_schema_sort(config->dnode, 1);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user