diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2020-08-27 14:29:23 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-08-27 14:52:41 +0200 |
commit | 54746f9b79b8a1bf76b4294594a23a6f90984d8b (patch) | |
tree | 0e60b061b1b422092543d35f2f753805f37bd01a | |
parent | bc4c81fb43ef8bbcb851c804935ae4f4634050e9 (diff) | |
download | NetworkManager-bg/rh1818697.tar.gz |
device: fix autoactivating virtual devices after a failurebg/rh1818697
When a virtual device fails, its state goes to FAIL and then
DISCONNECTED. In DISCONNECTED we call schedule_activate_check() to
schedule an auto-activation if needed. We also schudule the deletion
of the link through delete_on_deactivate_check_and_schedule(). The
auto-activation attempt fails because the link deletion unmanages the
device; as a result, the device doesn't try to auto-activate again.
To fix this:
- don't allow the device to auto-activate if the device deletion is
pending;
- check again if the device can be auto-activated after its deletion.
https://bugzilla.redhat.com/show_bug.cgi?id=1818697
-rw-r--r-- | src/devices/nm-device.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index c1c2774d6a..9c4b2288b2 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6023,6 +6023,9 @@ nm_device_autoconnect_allowed (NMDevice *self) return FALSE; } + if (priv->delete_on_deactivate_data) + return FALSE; + /* The 'autoconnect-allowed' signal is emitted on a device to allow * other listeners to block autoconnect on the device if they wish. * This is mainly used by the OLPC Mesh devices to block autoconnect @@ -12058,6 +12061,8 @@ delete_on_deactivate_link_delete (gpointer user_data) } else if (data->ifindex > 0) nm_platform_link_delete (nm_device_get_platform (self), data->ifindex); + nm_device_emit_recheck_auto_activate (self); + g_free (data); return FALSE; } |