summary refs log tree commit diff
path: root/src/core/devices/nm-device-vlan.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-01-13 22:30:39 +0100
committerMichael Biebl <biebl@debian.org>2022-01-13 22:30:39 +0100
commit88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (patch)
tree71f32df6617802270e8a78574bd8e1637dc532f4 /src/core/devices/nm-device-vlan.c
parente74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff)
New upstream version 1.34.0 upstream/1.34.0
Diffstat (limited to 'src/core/devices/nm-device-vlan.c')
-rw-r--r--src/core/devices/nm-device-vlan.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/devices/nm-device-vlan.c b/src/core/devices/nm-device-vlan.c
index 548245f8..d1e57411 100644
--- a/src/core/devices/nm-device-vlan.c
+++ b/src/core/devices/nm-device-vlan.c
@@ -19,6 +19,7 @@
 #include "libnm-platform/nm-platform.h"
 #include "nm-device-factory.h"
 #include "nm-manager.h"
+#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
 #include "libnm-core-intern/nm-core-internal.h"
 #include "libnm-platform/nmp-object.h"
 #include "libnm-platform/nm-platform-utils.h"
@@ -432,18 +433,13 @@ static void
 update_connection(NMDevice *device, NMConnection *connection)
 {
     NMDeviceVlanPrivate * priv    = NM_DEVICE_VLAN_GET_PRIVATE(device);
-    NMSettingVlan *       s_vlan  = nm_connection_get_setting_vlan(connection);
+    NMSettingVlan *       s_vlan  = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VLAN);
     int                   ifindex = nm_device_get_ifindex(device);
     const NMPlatformLink *plink;
     const NMPObject *     polnk;
     guint                 vlan_id;
     _NMVlanFlags          vlan_flags;
 
-    if (!s_vlan) {
-        s_vlan = (NMSettingVlan *) nm_setting_vlan_new();
-        nm_connection_add_setting(connection, (NMSetting *) s_vlan);
-    }
-
     polnk = nm_platform_link_get_lnk(nm_device_get_platform(device),
                                      ifindex,
                                      NM_LINK_TYPE_VLAN,