mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-19 05:30:38 +02:00
core: avoid unnecessary action in NMPolicy's _deactivate_if_active()
We only need @state, after we verified that the active connection references the right settings connection. Most of the time, that is not the case.
This commit is contained in:
parent
dcbb5c07e1
commit
ebd53888b6
1 changed files with 1 additions and 2 deletions
|
|
@ -2321,10 +2321,9 @@ _deactivate_if_active (NMPolicy *self, NMSettingsConnection *connection)
|
|||
nm_assert (NM_IS_SETTINGS_CONNECTION (connection));
|
||||
|
||||
nm_manager_for_each_active_connection (priv->manager, ac, tmp_list) {
|
||||
NMActiveConnectionState state = nm_active_connection_get_state (ac);
|
||||
|
||||
if ( nm_active_connection_get_settings_connection (ac) == connection
|
||||
&& (state <= NM_ACTIVE_CONNECTION_STATE_ACTIVATED)) {
|
||||
&& (nm_active_connection_get_state (ac) <= NM_ACTIVE_CONNECTION_STATE_ACTIVATED)) {
|
||||
if (!nm_manager_deactivate_connection (priv->manager,
|
||||
ac,
|
||||
NM_DEVICE_STATE_REASON_CONNECTION_REMOVED,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue