Revert "core: fail connections if IP configuration expires" (rh #616084) (rh #590874)

This reverts commit b172519045.

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.
This commit is contained in:
Dan Williams 2010-07-27 20:31:27 -07:00
parent ba3dcc2b08
commit af2be00b8c
2 changed files with 4 additions and 33 deletions

View file

@ -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;
}

View file

@ -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;