mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 09:10:10 +01:00
device: refactor by adding set_unmanaged_external_down() function
No functional change.
This commit is contained in:
parent
f7523ae6e2
commit
3c8ffa766c
1 changed files with 23 additions and 16 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue