mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 03:20:34 +01:00
device: only invalidate connections if they failed during activation
Otherwise, connections used to get marked invalid on hot-unplug, which isn't really correct.
This commit is contained in:
parent
f28a0df4a6
commit
9b55936dee
1 changed files with 6 additions and 2 deletions
|
|
@ -765,8 +765,12 @@ device_state_changed (NMDevice *device,
|
|||
|
||||
switch (new_state) {
|
||||
case NM_DEVICE_STATE_FAILED:
|
||||
/* Mark the connection invalid so it doesn't get automatically chosen */
|
||||
if (connection) {
|
||||
/* Mark the connection invalid if it failed during activation so that
|
||||
* it doesn't get automatically chosen over and over and over again.
|
||||
*/
|
||||
if ( connection
|
||||
&& (old_state > NM_DEVICE_STATE_DISCONNECTED)
|
||||
&& (old_state < NM_DEVICE_STATE_ACTIVATED)) {
|
||||
g_object_set_data (G_OBJECT (connection), INVALID_TAG, GUINT_TO_POINTER (TRUE));
|
||||
nm_info ("Marking connection '%s' invalid.", get_connection_id (connection));
|
||||
nm_connection_clear_secrets (connection);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue