From eadaa1f2c10fbab0c0aa2189b50432bf5823bb18 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 27 Jul 2010 20:31:27 -0700 Subject: [PATCH] Revert "core: fail connections if IP configuration expires" (rh #616084) (rh #590874) This reverts commit b172519045e5ea4825f85fca81de8395e92600c1. When something like NTP updates the system clock, that can cause dhclient to expire the lease, and at that point we just want NM to let dhclient re-aquire the lease instead of failing the whole connection. --- src/nm-device.c | 16 ---------------- src/nm-policy.c | 21 ++++----------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/nm-device.c b/src/nm-device.c index 84eb97730a..98be23cd00 100644 --- a/src/nm-device.c +++ b/src/nm-device.c @@ -1439,22 +1439,6 @@ dhcp_state_changed (NMDHCPClient *client, } else if (nm_device_get_state (device) == NM_DEVICE_STATE_ACTIVATED) nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); break; - case DHC_STOP: - case DHC_STOP6: - case DHC_EXPIRE: - case DHC_EXPIRE6: - if (dev_state == NM_DEVICE_STATE_ACTIVATED) { - if (ipv6) - nm_dhcp6_config_reset (priv->dhcp6_config); - else - nm_dhcp4_config_reset (priv->dhcp4_config); - - /* dhclient quit and can't get/renew a lease; so kill the connection */ - nm_device_state_changed (device, - NM_DEVICE_STATE_FAILED, - NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED); - } - break; default: break; } diff --git a/src/nm-policy.c b/src/nm-policy.c index 833a58764c..ddf48ad877 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -892,23 +892,10 @@ device_state_changed (NMDevice *device, /* Mark the connection invalid if it failed during activation so that * it doesn't get automatically chosen over and over and over again. */ - if (connection) { - gboolean fail = FALSE; - - if (IS_ACTIVATING_STATE (old_state)) { - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); - fail = TRUE; - } else if ( (old_state == NM_DEVICE_STATE_ACTIVATED) - && (reason == NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED)) { - nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid because IP configuration expired.", - get_connection_id (connection)); - fail = TRUE; - } - - if (fail) { - g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); - nm_connection_clear_secrets (connection); - } + if (connection && IS_ACTIVATING_STATE (old_state)) { + g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE)); + nm_log_info (LOGD_DEVICE, "Marking connection '%s' invalid.", get_connection_id (connection)); + nm_connection_clear_secrets (connection); } schedule_activate_check (policy, device, 3); break;