mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 17:10:12 +01:00
device: retry DHCP after timeout/expiration for assumed connections
If DHCP fails for an assumed connection, NetworkManager would transition the device to the FAILED and then to the ACTIVATED state (because it is assumed); hence if the DHCP server goes temporarily down the device will go into a permanent state without IP configuration. Fix this and try DHCP again after some time when the connection is an assumed one. https://bugzilla.redhat.com/show_bug.cgi?id=1246496
This commit is contained in:
parent
317b6cb880
commit
2b9db2bf1b
1 changed files with 20 additions and 0 deletions
|
|
@ -3467,6 +3467,16 @@ dhcp4_fail (NMDevice *self, gboolean timeout)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Instead of letting an assumed connection fail (which means that the
|
||||
* device will transition to the ACTIVATED state without IP configuration),
|
||||
* retry DHCP again.
|
||||
*/
|
||||
if (nm_device_uses_assumed_connection (self)) {
|
||||
_LOGI (LOGD_DHCP4, "Scheduling DHCPv4 restart because the connection is assumed");
|
||||
priv->dhcp4_restart_id = g_timeout_add_seconds (120, dhcp4_restart_cb, self);
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeout || (priv->ip4_state == IP_CONF))
|
||||
nm_device_activate_schedule_ip4_config_timeout (self);
|
||||
else if (priv->ip4_state == IP_DONE)
|
||||
|
|
@ -4141,6 +4151,16 @@ dhcp6_fail (NMDevice *self, gboolean timeout)
|
|||
return;
|
||||
}
|
||||
|
||||
/* Instead of letting an assumed connection fail (which means that the
|
||||
* device will transition to the ACTIVATED state without IP configuration),
|
||||
* retry DHCP again.
|
||||
*/
|
||||
if (nm_device_uses_assumed_connection (self)) {
|
||||
_LOGI (LOGD_DHCP6, "Scheduling DHCPv6 restart because the connection is assumed");
|
||||
priv->dhcp6_restart_id = g_timeout_add_seconds (120, dhcp6_restart_cb, self);
|
||||
return;
|
||||
}
|
||||
|
||||
if (timeout || (priv->ip6_state == IP_CONF))
|
||||
nm_device_activate_schedule_ip6_config_timeout (self);
|
||||
else if (priv->ip6_state == IP_DONE)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue