Skip to content

Commit 33999ce

Browse files
committed
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 <[email protected]>
1 parent 79ad653 commit 33999ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/confd/src/infix-dhcp-server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,6 @@ int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config,
300300
int enabled = 0, added = 0, deleted = 0;
301301
sr_error_t err = 0;
302302

303-
if (!lydx_get_xpathf(diff, CFG_XPATH))
304-
return SR_ERR_OK;
305-
306303
switch (event) {
307304
case SR_EV_DONE:
308305
break;
@@ -312,6 +309,9 @@ int infix_dhcp_server_change(sr_session_ctx_t *session, struct lyd_node *config,
312309
return SR_ERR_OK;
313310
}
314311

312+
if (!lydx_get_xpathf(diff, CFG_XPATH))
313+
return SR_ERR_OK;
314+
315315
global = lydx_get_descendant(config, "dhcp-server", NULL);
316316
enabled = lydx_is_enabled(global, "enabled");
317317

0 commit comments

Comments
 (0)