merge: fix DHCP 'expire' state handling (rh #1139326) (bgo #737225)

This commit is contained in:
Dan Williams 2014-10-02 15:03:00 -05:00
commit e80d03b5fa
2 changed files with 9 additions and 3 deletions

View file

@ -2686,8 +2686,10 @@ dhcp4_fail (NMDevice *self, gboolean timeout)
dhcp4_cleanup (self, TRUE, FALSE);
if (timeout || (priv->ip4_state == IP_CONF))
nm_device_activate_schedule_ip4_config_timeout (self);
else if (priv->ip4_state == IP_FAIL)
else if (priv->ip4_state == IP_DONE)
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED);
else
g_warn_if_reached ();
}
static void
@ -3121,8 +3123,10 @@ dhcp6_fail (NMDevice *self, gboolean timeout)
if (priv->dhcp6_mode == NM_RDISC_DHCP_LEVEL_MANAGED) {
if (timeout || (priv->ip6_state == IP_CONF))
nm_device_activate_schedule_ip6_config_timeout (self);
else if (priv->ip6_state == IP_FAIL)
else if (priv->ip6_state == IP_DONE)
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED);
else
g_warn_if_reached ();
} else {
/* not a hard failure; just live with the RA info */
if (priv->ip6_state == IP_CONF)

View file

@ -178,7 +178,9 @@ reason_to_state (const char *iface, const char *reason)
return NM_DHCP_STATE_DONE;
else if (g_ascii_strcasecmp (reason, "fail") == 0 ||
g_ascii_strcasecmp (reason, "abend") == 0 ||
g_ascii_strcasecmp (reason, "nak") == 0)
g_ascii_strcasecmp (reason, "nak") == 0 ||
g_ascii_strcasecmp (reason, "expire") == 0 ||
g_ascii_strcasecmp (reason, "expire6") == 0)
return NM_DHCP_STATE_FAIL;
nm_log_dbg (LOGD_DHCP, "(%s): unmapped DHCP state '%s'", iface, reason);