mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-04 06:43:00 +02:00
confd: fix annoying warning in log
This fixes the annoying libyang warning after commit da29771.
confd[3375]: libyang[0]: Invalid argument ctx_node (lyd_find_xpath()).
This happens when the diff is used in the wrong event when it is NULL.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -300,9 +300,6 @@ int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config,
|
||||
int enabled = 0, added = 0, deleted = 0;
|
||||
sr_error_t err = 0;
|
||||
|
||||
if (!lydx_get_xpathf(diff, CFG_XPATH))
|
||||
return SR_ERR_OK;
|
||||
|
||||
switch (event) {
|
||||
case SR_EV_DONE:
|
||||
break;
|
||||
@@ -312,6 +309,9 @@ int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config,
|
||||
return SR_ERR_OK;
|
||||
}
|
||||
|
||||
if (!lydx_get_xpathf(diff, CFG_XPATH))
|
||||
return SR_ERR_OK;
|
||||
|
||||
global = lydx_get_descendant(config, "dhcp-server", NULL);
|
||||
enabled = lydx_is_enabled(global, "enabled");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user