Commit e1edcda3 authored by Thomas Haller's avatar Thomas Haller
Browse files

device: consider external devices as unmanaged until they have an IP address

parent 207c0f5f
......@@ -1210,20 +1210,26 @@ is_unmanaged_external_down (NMDevice *self, gboolean consider_can)
/* Manage externally-created software interfaces only when they are IFF_UP */
if ( priv->ifindex <= 0
|| !priv->up)
|| !priv->up
|| !nm_platform_link_can_assume (NM_PLATFORM_GET, priv->ifindex))
return NM_UNMAN_FLAG_OP_SET_UNMANAGED;
return NM_UNMAN_FLAG_OP_SET_MANAGED;
}
static void
set_unmanaged_external_down (NMDevice *self)
set_unmanaged_external_down (NMDevice *self, gboolean only_if_unmanaged)
{
NMUnmanFlagOp ext_flags;
if (!nm_device_get_unmanaged_mask (self, NM_UNMANAGED_EXTERNAL_DOWN))
return;
if (only_if_unmanaged) {
if (!nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN))
return;
}
ext_flags = is_unmanaged_external_down (self, FALSE);
if (ext_flags != NM_UNMAN_FLAG_OP_SET_UNMANAGED) {
/* Ensure the assume check is queued before any queued state changes
......@@ -1562,7 +1568,7 @@ device_link_changed (NMDevice *self)
nm_device_set_unmanaged_by_flags (self, NM_UNMANAGED_PLATFORM_INIT, FALSE, reason);
}
set_unmanaged_external_down (self);
set_unmanaged_external_down (self, FALSE);
device_recheck_slave_status (self, &info);
return G_SOURCE_REMOVE;
......@@ -8879,6 +8885,8 @@ queued_ip4_config_change (gpointer user_data)
update_ip4_config (self, FALSE);
g_object_unref (self);
set_unmanaged_external_down (self, TRUE);
return FALSE;
}
......@@ -8933,6 +8941,8 @@ queued_ip6_config_change (gpointer user_data)
g_object_unref (self);
set_unmanaged_external_down (self, TRUE);
return FALSE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment