diff options
author | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-07-24 12:45:02 +0200 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-07-26 09:28:30 +0200 |
commit | 33ce44002c27b03d29e3e9a890f665354d2d154c (patch) | |
tree | 09a4aab5c2c3a09560c2ce3cad322f0a437a57e9 | |
parent | 9f01cff04f4a0aac5e4438e6bdb0e5c68594a706 (diff) |
device: delete software device when lose carrier and is controllerff/vlan_automatically_revive
Software devices that are controllers like bond/bridge/team when
configured to not ignore carrier are being deleted when deactivating the
device. Software devices that are not controllers, shouldn't be deleted.
Otherwise, if a VLAN link is deleted because the ethernet carrier-change
then NetworkManager won't be able to reactivate the VLAN once the
ethernet gets carrier because the link is not present.
This is restoring the previous behaviour and it's know to be relied on
by users.
https://bugzilla.redhat.com/show_bug.cgi?id=2224479
Fixes: efa63aef3aeb ('device: delete software device when software devices lose carrier')
-rw-r--r-- | src/core/devices/nm-device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 10df06ae7e..2038e2f205 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -15769,7 +15769,11 @@ _cleanup_generic_post(NMDevice *self, NMDeviceStateReason reason, CleanupType cl act_request_set(self, NULL); } - if (cleanup_type == CLEANUP_TYPE_DECONFIGURE && reason != NM_DEVICE_STATE_REASON_NOW_MANAGED) { + if (cleanup_type == CLEANUP_TYPE_DECONFIGURE + && ((reason == NM_DEVICE_STATE_REASON_CARRIER && nm_device_is_master(self)) + || !NM_IN_SET(reason, + NM_DEVICE_STATE_REASON_NOW_MANAGED, + NM_DEVICE_STATE_REASON_CARRIER))) { /* Check if the device was deactivated, and if so, delete_link. * Don't call delete_link synchronously because we are currently * handling a state change -- which is not reentrant. */ |