diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2015-04-20 22:13:41 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2015-05-11 10:48:48 +0200 |
commit | 33d4232c3d66d865052493443c4315bfc62005eb (patch) | |
tree | ba1bc8103ebb5be0ca5c5c1393bfdf7b035a9fad | |
parent | 7a7f280ef3dd567b8d3004e1990f04cf113662b8 (diff) | |
download | NetworkManager-33d4232c3d66d865052493443c4315bfc62005eb.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.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 32c0b07b0b..826c417f42 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -2695,6 +2695,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 */ @@ -4907,42 +4943,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 |