fix: dhcp client host name resend

Signed-off-by: Ejub Sabic <ejub1946@outlook.com>
This commit is contained in:
Ejub Sabic
2026-04-28 18:00:32 +02:00
parent 17965bf4cc
commit 08ca47fdab
2 changed files with 19 additions and 13 deletions
+14
View File
@@ -180,6 +180,20 @@ int dhcp_client_change(sr_session_ctx_t *session, struct lyd_node *config, struc
ifaces = lydx_get_descendant(config, "interfaces", "interface", NULL);
difaces = lydx_get_descendant(diff, "interfaces", "interface", NULL);
if (diff && lydx_get_xpathf(diff, "/ietf-system:system/hostname")) {
LYX_LIST_FOR_EACH(ifaces, iface, "interface") {
const char *ifname = lydx_get_cattr(iface, "name");
ipv4 = lydx_get_descendant(lyd_child(iface), "ipv4", NULL);
if (!ipv4)
continue;
dhcp = lydx_get_descendant(lyd_child(ipv4), "dhcp", NULL);
if (dhcp)
add(ifname, dhcp);
}
}
/* find the modified interfaces */
LYX_LIST_FOR_EACH(difaces, diface, "interface") {
const char *ifname = lydx_get_cattr(diface, "name");