From: Yu Watanabe Date: Sat, 18 Apr 2026 23:37:53 +0000 (+0900) Subject: sd-dhcp-client: propagate failure in setting timer and stop the client X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b831cd00e6777b32b08cc1848b5ff9c6c981f128;p=thirdparty%2Fsystemd.git sd-dhcp-client: propagate failure in setting timer and stop the client If we fail to setup timer event sources about the lease lifetime or T1/T2, then the lease will be never updated, and the user (networkd) will not receive any notification about the expire. The situation is terrible. Let's stop the client with error code earlier, and notify the failure to networkd. --- diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 76558bdd72e..f6ab4b34dfc 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -1769,7 +1769,7 @@ static int client_enter_bound(sd_dhcp_client *client, int notify_event) { r = client_set_lease_timeouts(client); if (r < 0) - log_dhcp_client_errno(client, r, "Failed to set lease timeouts: %m"); + return log_dhcp_client_errno(client, r, "Failed to set lease timeouts: %m"); client_notify(client, notify_event); return 0;