From: noxiouz Date: Tue, 7 Apr 2026 13:47:44 +0000 (+0100) Subject: networkd: keep static lease section valid on MACAddress= reset X-Git-Tag: v261-rc1~568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34649c6f558f78470451cedb294ae8f859791ead;p=thirdparty%2Fsystemd.git networkd: keep static lease section valid on MACAddress= reset config_parse_dhcp_static_lease_hwaddr() uses a cleanup helper that marks a lease section invalid unless ownership is taken. Add TAKE_PTR(lease) on the empty-rvalue reset path so subsequent valid MACAddress= assignments in the same section are not dropped. Co-developed-by: Codex (GPT-5) --- diff --git a/src/network/networkd-dhcp-server-static-lease.c b/src/network/networkd-dhcp-server-static-lease.c index 2f04232c49f..2814be8987c 100644 --- a/src/network/networkd-dhcp-server-static-lease.c +++ b/src/network/networkd-dhcp-server-static-lease.c @@ -188,6 +188,7 @@ int config_parse_dhcp_static_lease_hwaddr( if (isempty(rvalue)) { lease->client_id = mfree(lease->client_id); lease->client_id_size = 0; + TAKE_PTR(lease); return 0; }