mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-04 03:40:38 +01:00
Revert "wifi: don't autoconnect to networks that have never been successful"
As commitccfe5fec8d('wifi: don't autoconnect to networks that have never been successful') explains, Wi-Fi profiles only autoconnected if they had no or a positive timestamp. The problem that tried to solve is when a user accidentally clicks on a Wi-Fi network in applet. Then the created profile may not be usable (because of wrong credentials). To avoid indefinitely to autoconnect, uch a profile will have a timestamp of 0, which prevents further auto activations. However, I find that problematic. An important use case is pre-deploying profiles. In that case, the user cannot set the timestamp, because the timestamp cache /var/lib/NetworkManager/timestamps is internal, undocumented API. Also, ifcfg-rh doesn't support the timestamp and anyway, does the timestamp of the NMConnection does not get honored (only the one from the timestamps file). Maybe that could be an alternative solution here, to allow the user to mark profiles as "I really want it to autoconnect". But that seems unnecessary and wrong to me. The problem really is that the user cannot do anything to ensure that autoconnect will work tomorrow (short of editing the timestamps database). The problem is that the property of whether a profile every connected successfully is not in direct control of the user (it depends on external conditions). If the user has bogus profiles configured, those profiles should be deleted (or autoconnect disabled) and not keep autoconnect blocked. Also note that if you are at home and accidentally click on your neighbour's Wi-Fi network, then you presumably still also have a working profile to your own network. That usable profile will have a more recent timestamp and be preferred during autoconnect already. This reverts commitccfe5fec8d. https://bugzilla.redhat.com/show_bug.cgi?id=1781253
This commit is contained in:
parent
a9d20141b9
commit
835175e4fb
1 changed files with 0 additions and 10 deletions
|
|
@ -1287,7 +1287,6 @@ can_auto_connect (NMDevice *device,
|
|||
NMWifiAP *ap;
|
||||
const char *method6, *mode;
|
||||
gboolean auto4, auto6;
|
||||
guint64 timestamp = 0;
|
||||
|
||||
nm_assert (!specific_object || !*specific_object);
|
||||
|
||||
|
|
@ -1315,15 +1314,6 @@ can_auto_connect (NMDevice *device,
|
|||
else if (!auto4 && !auto6 && nm_streq0 (mode, NM_SETTING_WIRELESS_MODE_MESH))
|
||||
return TRUE;
|
||||
|
||||
/* Don't autoconnect to networks that have been tried at least once
|
||||
* but haven't been successful, since these are often accidental choices
|
||||
* from the menu and the user may not know the password.
|
||||
*/
|
||||
if (nm_settings_connection_get_timestamp (sett_conn, ×tamp)) {
|
||||
if (timestamp == 0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ap = nm_wifi_aps_find_first_compatible (&priv->aps_lst_head, connection);
|
||||
if (ap) {
|
||||
/* All good; connection is usable */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue