summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-04-21 08:51:55 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-04-25 19:25:37 +0200
commita455db9113e9b6b2b3a1a0b8a2c0be602ba57264 (patch)
treec31b94617395732578704c86a827ef64d9b0e1a0
parentd403d57b0b0c2205d0c3b554e61b43b5bd6a32a1 (diff)
downloadNetworkManager-a455db9113e9b6b2b3a1a0b8a2c0be602ba57264.tar.gz
device: fix device state transition after IPv4LL failure
Don't terminate the entire connection if IPv4LL configuration fails but instead call nm_device_check_ip_failed() to check the result of IPv6 as well.
-rw-r--r--src/devices/nm-device.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index c4a77da388..c505554456 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2715,7 +2715,6 @@ nm_device_handle_ipv4ll_event (NMDevice *self,
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMConnection *connection = NULL;
const char *method;
- NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE;
g_return_if_fail (event != NULL);
@@ -2736,20 +2735,23 @@ nm_device_handle_ipv4ll_event (NMDevice *self,
if (inet_pton (AF_INET, address, &lla) <= 0) {
_LOGE (LOGD_AUTOIP4, "invalid address %s received from avahi-autoipd.", address);
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR);
+ priv->ip4_state = IP_FAIL;
+ nm_device_check_ip_failed (self, FALSE);
return;
}
if ((lla & IPV4LL_NETMASK) != IPV4LL_NETWORK) {
_LOGE (LOGD_AUTOIP4, "invalid address %s received from avahi-autoipd (not link-local).", address);
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_AUTOIP_ERROR);
+ priv->ip4_state = IP_FAIL;
+ nm_device_check_ip_failed (self, FALSE);
return;
}
config = ipv4ll_get_ip4_config (self, lla);
if (config == NULL) {
_LOGE (LOGD_AUTOIP4, "failed to get IPv4LL config");
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
+ priv->ip4_state = IP_FAIL;
+ nm_device_check_ip_failed (self, FALSE);
return;
}
@@ -2757,9 +2759,10 @@ nm_device_handle_ipv4ll_event (NMDevice *self,
ipv4ll_timeout_remove (self);
nm_device_activate_schedule_ip4_config_result (self, config);
} else if (priv->ip4_state == IP_DONE) {
- if (!ip4_config_merge_and_apply (self, config, TRUE, &reason)) {
+ if (!ip4_config_merge_and_apply (self, config, TRUE, NULL)) {
_LOGE (LOGD_AUTOIP4, "failed to update IP4 config for autoip change.");
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, reason);
+ priv->ip4_state = IP_FAIL;
+ nm_device_check_ip_failed (self, FALSE);
}
} else
g_assert_not_reached ();
@@ -2767,9 +2770,8 @@ nm_device_handle_ipv4ll_event (NMDevice *self,
g_object_unref (config);
} else {
_LOGW (LOGD_AUTOIP4, "IPv4LL address %s no longer valid because '%s'.", address, event);
-
- /* The address is gone; terminate the connection or fail activation */
- nm_device_state_changed (self, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED);
+ priv->ip4_state = IP_FAIL;
+ nm_device_check_ip_failed (self, FALSE);
}
}