From 6af6f70d812249bdbc27d63fbd9544c57c33d04d Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 23 Dec 2019 15:39:06 +0100 Subject: [PATCH] dhcp: nettools: start from init-reboot phase when reusing address If we know the address used previously, also tell the client to start from the init-reboot phase, so that it will start with a DHCP request instead of a discover. --- src/dhcp/nm-dhcp-nettools.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dhcp/nm-dhcp-nettools.c b/src/dhcp/nm-dhcp-nettools.c index fa5abda539..30820c615a 100644 --- a/src/dhcp/nm-dhcp-nettools.c +++ b/src/dhcp/nm-dhcp-nettools.c @@ -1311,8 +1311,10 @@ ip4_start (NMDhcpClient *client, sd_dhcp_lease_get_address (lease, &last_addr); } - if (last_addr.s_addr) + if (last_addr.s_addr) { n_dhcp4_client_probe_config_set_requested_ip (config, last_addr); + n_dhcp4_client_probe_config_set_init_reboot (config, TRUE); + } /* Add requested options */ for (i = 0; _nm_dhcp_option_dhcp4_options[i].name; i++) {