summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-04-07 14:48:49 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2023-04-11 09:19:03 +0200
commit89a8f51235b7cc9c39c2aea8ff717da4e051f8e6 (patch)
tree4eca82a3e8eb63ac17ea1d5f8ac6ce514a27b4db
parent640c82710f9b4d0569594ffb970350f437905bda (diff)
device: stop activation when queueing the unmanaged statebg/unmanage-race
When the unmanaged state is queued, we must ensure that the current activation doesn't overwrite the queue stated with a new one. This can happen for example if a dispatcher script or a firewall call terminate, or if the next activation stage is dispatched. Fixes-test: @preserve_master_and_ip_settings https://bugzilla.redhat.com/show_bug.cgi?id=2178269 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1599
-rw-r--r--src/core/devices/nm-device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 304bacaf3e..bbc2854671 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -14715,7 +14715,9 @@ _set_unmanaged_flags(NMDevice *self,
if (transition_state) {
new_state = was_managed ? NM_DEVICE_STATE_UNMANAGED : NM_DEVICE_STATE_UNAVAILABLE;
- if (new_state != NM_DEVICE_STATE_UNMANAGED) {
+ if (new_state == NM_DEVICE_STATE_UNMANAGED) {
+ _cancel_activation(self);
+ } else {
/* The assume check should happen before the device transitions to
* UNAVAILABLE, because in UNAVAILABLE we already clean up the IP
* configuration. Therefore, this function should never trigger a