summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-17 10:24:41 +0200
committerThomas Haller <thaller@redhat.com>2023-06-29 16:46:43 +0200
commit4693335043dd4d661b6386faf6aed04147d6b1c1 (patch)
tree8826b305e695fbca50df5a1b5e4b573f5cf0fdba
parent646e041523668a7bc19dc18e84e07e2aada89c2d (diff)
device: delete software device when disconnecting device due to loss of carrierth/rh2156684-ignore-carrier-2
It's not well defined when we delete devices. In general, we delete devices when the connection goes down and NetworkManager created the device earlier. Software devices like bond/bridge/team default to ignoring carrier. However, when configuring them to not ignore carrier ([device].ignore-carrier), they were not deleted when deactivating the devices. This adjusts commit d0c2a24b7140 ('device: do not remove software devices on initial disconnected (rh #1035814)'). Note that back then there was no check whether the device has an activation queued, so it behaved differently than.
-rw-r--r--src/core/devices/nm-device.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index e2a49de53e..558d05ce44 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -12899,11 +12899,9 @@ delete_on_deactivate_check_and_schedule(NMDevice *self)
return;
if (nm_device_get_state(self) == NM_DEVICE_STATE_UNMANAGED)
return;
- if (nm_device_get_state(self) == NM_DEVICE_STATE_UNAVAILABLE)
- return;
- delete_on_deactivate_unschedule(self); /* always cancel and reschedule */
g_object_ref(self);
+ delete_on_deactivate_unschedule(self); /* always cancel and reschedule */
priv->delete_on_deactivate_idle_source =
nm_g_idle_add_source(delete_on_deactivate_link_delete, self);