mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 07:00:13 +01:00
device: don't fail activation when IP config is unavailable and unneeded
If we didn't start IPv4 and IPv6, but they're allowed to fail, progress the activation without failing it. Also, progress assumed connections to check-ip with whatever configuration that is available. https://bugzilla.redhat.com/show_bug.cgi?id=1141264
This commit is contained in:
parent
55af4add90
commit
4b3ad7709d
1 changed files with 40 additions and 15 deletions
|
|
@ -4536,6 +4536,42 @@ nm_device_activate_stage3_ip6_start (NMDevice *self)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
|
|
@ -4590,10 +4626,7 @@ nm_device_activate_stage3_ip_config_start (gpointer user_data)
|
|||
if (!nm_device_activate_stage3_ip6_start (self))
|
||||
goto out;
|
||||
|
||||
if (priv->ip4_state == IP_FAIL && priv->ip6_state == IP_FAIL) {
|
||||
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
|
||||
}
|
||||
nm_device_check_ip_failed (self, TRUE);
|
||||
|
||||
out:
|
||||
_LOGI (LOGD_DEVICE, "Activation: Stage 3 of 5 (IP Configure Start) complete.");
|
||||
|
|
@ -4708,11 +4741,7 @@ nm_device_activate_ip4_config_timeout (gpointer user_data)
|
|||
|
||||
priv->ip4_state = IP_FAIL;
|
||||
|
||||
/* If IPv4 failed and IPv6 failed, the activation fails */
|
||||
if (priv->ip6_state == IP_FAIL)
|
||||
nm_device_state_changed (self,
|
||||
NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
|
||||
nm_device_check_ip_failed (self, FALSE);
|
||||
|
||||
out:
|
||||
_LOGI (LOGD_DEVICE | LOGD_IP4,
|
||||
|
|
@ -4787,11 +4816,7 @@ nm_device_activate_ip6_config_timeout (gpointer user_data)
|
|||
|
||||
priv->ip6_state = IP_FAIL;
|
||||
|
||||
/* If IPv6 failed and IPv4 failed, the activation fails */
|
||||
if (priv->ip4_state == IP_FAIL)
|
||||
nm_device_state_changed (self,
|
||||
NM_DEVICE_STATE_FAILED,
|
||||
NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE);
|
||||
nm_device_check_ip_failed (self, FALSE);
|
||||
|
||||
out:
|
||||
_LOGI (LOGD_DEVICE | LOGD_IP6,
|
||||
|
|
@ -6065,7 +6090,7 @@ nm_device_start_ip_check (NMDevice *self)
|
|||
timeout = nm_setting_connection_get_gateway_ping_timeout (s_con);
|
||||
|
||||
if (timeout) {
|
||||
if (priv->ip4_state == IP_DONE) {
|
||||
if (priv->ip4_config && priv->ip4_state == IP_DONE) {
|
||||
guint gw = 0;
|
||||
|
||||
ping_binary = "/usr/bin/ping";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue