mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 17:20:11 +01:00
policy: skip external devices in any_devices_active()
any_devices_active() exists to avoid hostname update when no devices are
active. See [1] and commit b07f6712e9 ('policy: check for active
devices before triggering dns update on hostname change').
Soon, we will add support for loopback device, so "lo" will
almost always be activated (either externally or actively managed by
NetworkManager).
In any case, external devices should not count here, even if they appear
activating/activated.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1344303
This commit is contained in:
parent
18e107e098
commit
da29726b07
1 changed files with 3 additions and 2 deletions
|
|
@ -467,9 +467,10 @@ any_devices_active(NMPolicy *self)
|
|||
NMDeviceState state;
|
||||
|
||||
state = nm_device_get_state(device);
|
||||
if (state <= NM_DEVICE_STATE_DISCONNECTED || state >= NM_DEVICE_STATE_DEACTIVATING) {
|
||||
if (state <= NM_DEVICE_STATE_DISCONNECTED || state >= NM_DEVICE_STATE_DEACTIVATING)
|
||||
continue;
|
||||
if (nm_device_sys_iface_state_is_external(device))
|
||||
continue;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue