about summary refs log tree commit diff
path: root/src/core/nm-act-request.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2024-01-25 09:46:52 +0100
committerMichael Biebl <biebl@debian.org>2024-01-25 09:46:52 +0100
commitb6357ff41de179d0aa2e35a6d574e5749fe09002 (patch)
treeff038e98f4569fa3ba217266e6d288410ed84cd4 /src/core/nm-act-request.c
parent535ecf92edd8ad054ae8102a224c3dd8f3acf967 (diff)
parent70e18d99b8e3e77bb37e218d7ac582130156f8ef (diff)
Update upstream source from tag 'upstream/1.45.90'
Update to upstream version '1.45.90'
with Debian dir d723a85d75b9a8958dee17b97673a3fd9a80e18c
Diffstat (limited to 'src/core/nm-act-request.c')
-rw-r--r--src/core/nm-act-request.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/nm-act-request.c b/src/core/nm-act-request.c
index dce18ba4..bed7ffde 100644
--- a/src/core/nm-act-request.c
+++ b/src/core/nm-act-request.c
@@ -259,7 +259,8 @@ static void
 device_state_changed(NMActiveConnection *active,
                      NMDevice           *device,
                      NMDeviceState       new_state,
-                     NMDeviceState       old_state)
+                     NMDeviceState       old_state,
+                     NMDeviceStateReason reason)
 {
     NMActiveConnectionState       cur_ac_state    = nm_active_connection_get_state(active);
     NMActiveConnectionState       ac_state        = NM_ACTIVE_CONNECTION_STATE_UNKNOWN;
@@ -319,14 +320,20 @@ device_state_changed(NMActiveConnection *active,
                          active);
         break;
     case NM_DEVICE_STATE_DEACTIVATING:
+        if (reason == NM_DEVICE_STATE_REASON_USER_REQUESTED)
+            ac_state_reason = NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED;
+
         ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATING;
         break;
     case NM_DEVICE_STATE_FAILED:
     case NM_DEVICE_STATE_DISCONNECTED:
     case NM_DEVICE_STATE_UNMANAGED:
     case NM_DEVICE_STATE_UNAVAILABLE:
-        ac_state        = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED;
-        ac_state_reason = NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED;
+        ac_state = NM_ACTIVE_CONNECTION_STATE_DEACTIVATED;
+        if (reason == NM_DEVICE_STATE_REASON_USER_REQUESTED)
+            ac_state_reason = NM_ACTIVE_CONNECTION_STATE_REASON_USER_DISCONNECTED;
+        else
+            ac_state_reason = NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED;
 
         g_signal_handlers_disconnect_by_func(device, G_CALLBACK(device_notify), active);
         break;