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.
This commit is contained in:
Beniamino Galvani 2019-12-23 15:39:06 +01:00
parent dd3114deb0
commit 6af6f70d81

View file

@ -1311,8 +1311,10 @@ ip4_start (NMDhcpClient *client,
sd_dhcp_lease_get_address (lease, &last_addr); 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_requested_ip (config, last_addr);
n_dhcp4_client_probe_config_set_init_reboot (config, TRUE);
}
/* Add requested options */ /* Add requested options */
for (i = 0; _nm_dhcp_option_dhcp4_options[i].name; i++) { for (i = 0; _nm_dhcp_option_dhcp4_options[i].name; i++) {