summary refs log tree commit diff
path: root/src/core/devices/nm-device-wpan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/devices/nm-device-wpan.c')
-rw-r--r--src/core/devices/nm-device-wpan.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/core/devices/nm-device-wpan.c b/src/core/devices/nm-device-wpan.c
index 73d79410..9bc43a85 100644
--- a/src/core/devices/nm-device-wpan.c
+++ b/src/core/devices/nm-device-wpan.c
@@ -18,6 +18,7 @@
 #include "libnm-platform/nm-platform.h"
 #include "nm-device-factory.h"
 #include "nm-setting-wpan.h"
+#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
 #include "libnm-core-intern/nm-core-internal.h"
 
 #define _NMLOG_DEVICE_TYPE NMDeviceWpan
@@ -71,13 +72,7 @@ complete_connection(NMDevice *           device,
 static void
 update_connection(NMDevice *device, NMConnection *connection)
 {
-    NMSettingWpan *s_wpan =
-        NM_SETTING_WPAN(nm_connection_get_setting(connection, NM_TYPE_SETTING_WPAN));
-
-    if (!s_wpan) {
-        s_wpan = (NMSettingWpan *) nm_setting_wpan_new();
-        nm_connection_add_setting(connection, (NMSetting *) s_wpan);
-    }
+    _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_WPAN);
 }
 
 static gboolean