summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-12-10 10:23:40 -0600
committerDan Williams <dcbw@redhat.com>2014-12-11 09:24:48 -0600
commita1f4794c86d777f11e6201fdd110bf93c8299110 (patch)
treef66aef3af5f96a2b5373aaf15ea052ab8c5cfc27
parent67bf5cb1a34c7dcb4081254a859bf82421be1d48 (diff)
downloadNetworkManager-a1f4794c86d777f11e6201fdd110bf93c8299110.tar.gz
core: clean up half-done IP operations when re-entering NEED_AUTH state (bgo #741342)
When the device decides it needs re-auth during IP config and returns to the NEED_AUTH state, make sure we clean up any half-done IP operations since they will be re-started after auth is completed and the IP_CONFIG state is re-entered. https://bugzilla.gnome.org/show_bug.cgi?id=741342
-rw-r--r--src/devices/nm-device.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 50fc07562e..00f886bd3d 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -7002,13 +7002,29 @@ nm_device_has_pending_action (NMDevice *self)
/***********************************************************/
static void
+_cleanup_ip_pre (NMDevice *self, gboolean deconfigure)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+ priv->ip4_state = priv->ip6_state = IP_NONE;
+ nm_device_queued_ip_config_change_clear (self);
+
+ dhcp4_cleanup (self, deconfigure, FALSE);
+ arp_cleanup (self);
+ dhcp6_cleanup (self, deconfigure, FALSE);
+ linklocal6_cleanup (self);
+ addrconf6_cleanup (self);
+ dnsmasq_cleanup (self);
+ aipd_cleanup (self);
+}
+
+static void
_cleanup_generic_pre (NMDevice *self, gboolean deconfigure)
{
- NMConnection *connection;
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMConnection *connection;
/* Clean up when device was deactivated during call to firewall */
-
if (priv->fw_call) {
nm_firewall_manager_cancel_call (nm_firewall_manager_get (), priv->fw_call);
priv->fw_call = NULL;
@@ -7031,17 +7047,8 @@ _cleanup_generic_pre (NMDevice *self, gboolean deconfigure)
/* Clear any queued transitions */
nm_device_queued_state_clear (self);
- nm_device_queued_ip_config_change_clear (self);
- priv->ip4_state = priv->ip6_state = IP_NONE;
-
- dhcp4_cleanup (self, deconfigure, FALSE);
- arp_cleanup (self);
- dhcp6_cleanup (self, deconfigure, FALSE);
- linklocal6_cleanup (self);
- addrconf6_cleanup (self);
- dnsmasq_cleanup (self);
- aipd_cleanup (self);
+ _cleanup_ip_pre (self, deconfigure);
}
static void
@@ -7446,6 +7453,14 @@ _set_state_full (NMDevice *self,
nm_device_cleanup (self, reason);
}
break;
+ case NM_DEVICE_STATE_NEED_AUTH:
+ if (old_state > NM_DEVICE_STATE_NEED_AUTH) {
+ /* Clean up any half-done IP operations if the device's layer2
+ * finds out it needs authentication during IP config.
+ */
+ _cleanup_ip_pre (self, TRUE);
+ }
+ break;
default:
break;
}