From 514a3cb6100a1b9dc748f6a3f755dc64735255e1 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 10 May 2024 16:57:40 +0200 Subject: [PATCH] dhcp: remove the address synchronously on lease expiry When the lease expires, the DHCP client emits a LEASE_UPDATE event with a NULL l3cd. After returning from the handler, it sends immediately a DHCP DISCOVER message to try to get a new lease. It is important that when the DISCOVER gets sent the address is no longer configured on the interface. Otherwise, the server could see that it is already in use and assign a different one. Therefore, remove the address synchronously when handling the event. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532 --- src/core/devices/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index f3441508a..f23bc05d4 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -11053,7 +11053,7 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d priv->l3cfg, _dev_l3_config_data_tag_get(priv, L3_CONFIG_DATA_TYPE_DHCP_X(IS_IPv4)), dhcp_l3cd)) { - _dev_l3_cfg_commit(self, FALSE); + _dev_l3_cfg_commit(self, TRUE); } goto lease_update_out; }