policy: avoid false positives for checking for autoactivation
We want to only check for autoconnect all, if something happend that makes it possible that we can autoconnect now (while we couldn't previously). It's not a real problem to check more often then strictly necessary. But add a check to rule out a few false-positives to avoid the overhead of checking all devices for autoconnect.
This commit is contained in:
@@ -1430,6 +1430,7 @@ reset_autoconnect_all (NMPolicy *self,
|
||||
/* maybe the connection is still blocked afterwards for other reasons
|
||||
* and in the larger picture nothing changed. But it's too complicated
|
||||
* to find out exactly. Just assume, something changed to be sure. */
|
||||
if (!nm_settings_connection_autoconnect_is_blocked (connection))
|
||||
changed = TRUE;
|
||||
}
|
||||
} else {
|
||||
@@ -1441,10 +1442,12 @@ reset_autoconnect_all (NMPolicy *self,
|
||||
if (nm_settings_connection_autoconnect_blocked_reason_set (connection,
|
||||
NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_ALL
|
||||
& ~NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_USER_REQUEST,
|
||||
FALSE))
|
||||
FALSE)) {
|
||||
if (!nm_settings_connection_autoconnect_is_blocked (connection))
|
||||
changed = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
@@ -1615,9 +1618,11 @@ activate_slave_connections (NMPolicy *self, NMDevice *device)
|
||||
}
|
||||
if (nm_settings_connection_autoconnect_blocked_reason_set (connection,
|
||||
NM_SETTINGS_AUTO_CONNECT_BLOCKED_REASON_FAILED,
|
||||
FALSE))
|
||||
FALSE)) {
|
||||
if (!nm_settings_connection_autoconnect_is_blocked (connection))
|
||||
changed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
schedule_activate_all (self);
|
||||
|
Reference in New Issue
Block a user