summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-04-20 22:13:41 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-04-25 19:25:32 +0200
commitd403d57b0b0c2205d0c3b554e61b43b5bd6a32a1 (patch)
treebd902f028a42d3faab2deebfc196c0200d2af6ea
parentd00c64d3d05205da343dc0a1d6b65e373b0db27f (diff)
downloadNetworkManager-d403d57b0b0c2205d0c3b554e61b43b5bd6a32a1.tar.gz
device/trivial: move nm_device_check_ip_failed()
Move nm_device_check_ip_failed() upwards as it will be used by IPv4LL code.
-rw-r--r--src/devices/nm-device.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 0ec6c89fce..c4a77da388 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2609,6 +2609,42 @@ nm_device_activate_schedule_stage2_device_config (NMDevice *self)
_LOGD (LOGD_DEVICE, "Activation: Stage 2 of 5 (Device Configure) scheduled...");
}
+/*
+ * nm_device_check_ip_failed
+ *
+ * Progress the device to appropriate state if both IPv4 and IPv6 failed
+ */
+static void
+nm_device_check_ip_failed (NMDevice *self, gboolean may_fail)
+{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+ NMDeviceState state;
+
+ if ( priv->ip4_state != IP_FAIL
+ || priv->ip6_state != IP_FAIL)
+ return;
+
+ if (nm_device_uses_assumed_connection (self)) {
+ /* We have assumed configuration, but couldn't
+ * redo it. No problem, move to check state. */
+ priv->ip4_state = priv->ip6_state = IP_DONE;
+ state = NM_DEVICE_STATE_IP_CHECK;
+ } else if ( may_fail
+ && get_ip_config_may_fail (self, AF_INET)
+ && get_ip_config_may_fail (self, AF_INET6)) {
+ /* Couldn't start either IPv6 and IPv4 autoconfiguration,
+ * but both are allowed to fail. */
+ state = NM_DEVICE_STATE_SECONDARIES;
+ } else {
+ /* Autoconfiguration attempted without success. */
+ state = NM_DEVICE_STATE_FAILED;
+ }
+
+ nm_device_state_changed (self,
+ state,
+ NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
+}
+
/*********************************************/
/* IPv4LL stuff */
@@ -4827,42 +4863,6 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
}
/*
- * nm_device_check_ip_failed
- *
- * Progress the device to appropriate state if both IPv4 and IPv6 failed
- */
-static void
-nm_device_check_ip_failed (NMDevice *self, gboolean may_fail)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- NMDeviceState state;
-
- if ( priv->ip4_state != IP_FAIL
- || priv->ip6_state != IP_FAIL)
- return;
-
- if (nm_device_uses_assumed_connection (self)) {
- /* We have assumed configuration, but couldn't
- * redo it. No problem, move to check state. */
- priv->ip4_state = priv->ip6_state = IP_DONE;
- state = NM_DEVICE_STATE_IP_CHECK;
- } else if ( may_fail
- && get_ip_config_may_fail (self, AF_INET)
- && get_ip_config_may_fail (self, AF_INET6)) {
- /* Couldn't start either IPv6 and IPv4 autoconfiguration,
- * but both are allowed to fail. */
- state = NM_DEVICE_STATE_SECONDARIES;
- } else {
- /* Autoconfiguration attempted without success. */
- state = NM_DEVICE_STATE_FAILED;
- }
-
- nm_device_state_changed (self,
- state,
- NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
-}
-
-/*
* nm_device_activate_stage3_ip_config_start
*
* Begin automatic/manual IP configuration