summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-10-02 15:03:00 -0500
committerDan Williams <dcbw@redhat.com>2014-10-02 15:03:00 -0500
commite80d03b5fa3233d213f56d5c4da0847214cb4313 (patch)
tree564de6dd29d0e224483aaa35e1cce09fed78b661
parente2f5343b0853afe14487dbfaa8d86beebc932363 (diff)
parent90a77565d4c2e92e5798c463ca1e3baa4de51662 (diff)
downloadNetworkManager-e80d03b5fa3233d213f56d5c4da0847214cb4313.tar.gz
merge: fix DHCP 'expire' state handling (rh #1139326) (bgo #737225)
-rw-r--r--src/devices/nm-device.c8
-rw-r--r--src/dhcp-manager/nm-dhcp-client.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 75b07d2f03..21f50b0274 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -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)
diff --git a/src/dhcp-manager/nm-dhcp-client.c b/src/dhcp-manager/nm-dhcp-client.c
index 75a243649f..76700628ec 100644
--- a/src/dhcp-manager/nm-dhcp-client.c
+++ b/src/dhcp-manager/nm-dhcp-client.c
@@ -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);