Commit 3c8ffa76 authored by Thomas Haller's avatar Thomas Haller
Browse files

device: refactor by adding set_unmanaged_external_down() function

No functional change.
parent f7523ae6
......@@ -1216,6 +1216,28 @@ is_unmanaged_external_down (NMDevice *self, gboolean consider_can)
return NM_UNMAN_FLAG_OP_SET_MANAGED;
}
static void
set_unmanaged_external_down (NMDevice *self)
{
NMUnmanFlagOp ext_flags;
if (!nm_device_get_unmanaged_mask (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
* from the transition to UNAVAILABLE.
*/
nm_device_queue_recheck_assume (self);
}
nm_device_set_unmanaged_by_flags (self,
NM_UNMANAGED_EXTERNAL_DOWN,
ext_flags,
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
}
static void
update_dynamic_ip_setup (NMDevice *self)
{
......@@ -1536,22 +1558,7 @@ device_link_changed (NMDevice *self)
nm_device_set_unmanaged_by_flags (self, NM_UNMANAGED_PLATFORM_INIT, FALSE, reason);
}
if (nm_device_get_unmanaged_mask (self, NM_UNMANAGED_EXTERNAL_DOWN)) {
NMUnmanFlagOp ext_flags;
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
* from the transition to UNAVAILABLE.
*/
nm_device_queue_recheck_assume (self);
}
nm_device_set_unmanaged_by_flags (self,
NM_UNMANAGED_EXTERNAL_DOWN,
ext_flags,
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
}
set_unmanaged_external_down (self);
device_recheck_slave_status (self, &info);
return G_SOURCE_REMOVE;
......
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