|
|
ab7d06 |
From d381c50724079e3a774892db70146269697ee1ef Mon Sep 17 00:00:00 2001
|
|
|
ab7d06 |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
ab7d06 |
Date: Wed, 2 Sep 2015 10:14:35 +0200
|
|
|
ab7d06 |
Subject: [PATCH] device: retry DHCP after timeout/expiration for assumed
|
|
|
ab7d06 |
connections
|
|
|
ab7d06 |
|
|
|
ab7d06 |
If DHCP fails for an assumed connection, NetworkManager would
|
|
|
ab7d06 |
transition the device to the FAILED and then to the ACTIVATED state
|
|
|
ab7d06 |
(because it is assumed); hence if the DHCP server goes temporarily
|
|
|
ab7d06 |
down the device will go into a permanent state without IP
|
|
|
ab7d06 |
configuration.
|
|
|
ab7d06 |
|
|
|
ab7d06 |
Fix this and try DHCP again after some time when the connection
|
|
|
ab7d06 |
is an assumed one.
|
|
|
ab7d06 |
|
|
|
ab7d06 |
https://bugzilla.redhat.com/show_bug.cgi?id=1246496
|
|
|
ab7d06 |
(cherry picked from commit 2b9db2bf1b9f12586381d90a653bfe7c92f0d7e7)
|
|
|
ab7d06 |
---
|
|
|
ab7d06 |
src/devices/nm-device.c | 20 ++++++++++++++++++++
|
|
|
ab7d06 |
1 file changed, 20 insertions(+)
|
|
|
ab7d06 |
|
|
|
ab7d06 |
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
|
|
|
ab7d06 |
index d75bf5e..3a7d991 100644
|
|
|
ab7d06 |
--- a/src/devices/nm-device.c
|
|
|
ab7d06 |
+++ b/src/devices/nm-device.c
|
|
|
ab7d06 |
@@ -3467,6 +3467,16 @@ dhcp4_fail (NMDevice *self, gboolean timeout)
|
|
|
ab7d06 |
return;
|
|
|
ab7d06 |
}
|
|
|
ab7d06 |
|
|
|
ab7d06 |
+ /* Instead of letting an assumed connection fail (which means that the
|
|
|
ab7d06 |
+ * device will transition to the ACTIVATED state without IP configuration),
|
|
|
ab7d06 |
+ * retry DHCP again.
|
|
|
ab7d06 |
+ */
|
|
|
ab7d06 |
+ if (nm_device_uses_assumed_connection (self)) {
|
|
|
ab7d06 |
+ _LOGI (LOGD_DHCP4, "Scheduling DHCPv4 restart because the connection is assumed");
|
|
|
ab7d06 |
+ priv->dhcp4_restart_id = g_timeout_add_seconds (120, dhcp4_restart_cb, self);
|
|
|
ab7d06 |
+ return;
|
|
|
ab7d06 |
+ }
|
|
|
ab7d06 |
+
|
|
|
ab7d06 |
if (timeout || (priv->ip4_state == IP_CONF))
|
|
|
ab7d06 |
nm_device_activate_schedule_ip4_config_timeout (self);
|
|
|
ab7d06 |
else if (priv->ip4_state == IP_DONE)
|
|
|
ab7d06 |
@@ -4141,6 +4151,16 @@ dhcp6_fail (NMDevice *self, gboolean timeout)
|
|
|
ab7d06 |
return;
|
|
|
ab7d06 |
}
|
|
|
ab7d06 |
|
|
|
ab7d06 |
+ /* Instead of letting an assumed connection fail (which means that the
|
|
|
ab7d06 |
+ * device will transition to the ACTIVATED state without IP configuration),
|
|
|
ab7d06 |
+ * retry DHCP again.
|
|
|
ab7d06 |
+ */
|
|
|
ab7d06 |
+ if (nm_device_uses_assumed_connection (self)) {
|
|
|
ab7d06 |
+ _LOGI (LOGD_DHCP6, "Scheduling DHCPv6 restart because the connection is assumed");
|
|
|
ab7d06 |
+ priv->dhcp6_restart_id = g_timeout_add_seconds (120, dhcp6_restart_cb, self);
|
|
|
ab7d06 |
+ return;
|
|
|
ab7d06 |
+ }
|
|
|
ab7d06 |
+
|
|
|
ab7d06 |
if (timeout || (priv->ip6_state == IP_CONF))
|
|
|
ab7d06 |
nm_device_activate_schedule_ip6_config_timeout (self);
|
|
|
ab7d06 |
else if (priv->ip6_state == IP_DONE)
|
|
|
ab7d06 |
--
|
|
|
ab7d06 |
2.4.3
|
|
|
ab7d06 |
|