about summary refs log tree commit diff
path: root/src/core/devices/nm-device-vrf.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-01-13 22:34:27 +0100
committerMichael Biebl <biebl@debian.org>2022-01-13 22:34:27 +0100
commitdd97d276b5d70c3397a4e59c978ca5228f06ba44 (patch)
tree5fb3f5e0f5da28e39d3261d50561349a512ba297 /src/core/devices/nm-device-vrf.c
parent3e2f6719468f8d957ae3cb112f3cb75b9c82d6a7 (diff)
parent88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (diff)
Update upstream source from tag 'upstream/1.34.0'
Update to upstream version '1.34.0'
with Debian dir b598c27ee9cef517760bc745aa6a3bb7d9fb2ecb
Diffstat (limited to 'src/core/devices/nm-device-vrf.c')
-rw-r--r--src/core/devices/nm-device-vrf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/devices/nm-device-vrf.c b/src/core/devices/nm-device-vrf.c
index 2a1f42c6..c752fa0a 100644
--- a/src/core/devices/nm-device-vrf.c
+++ b/src/core/devices/nm-device-vrf.c
@@ -9,6 +9,7 @@
 #include "nm-device-private.h"
 #include "nm-manager.h"
 #include "nm-setting-vrf.h"
+#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
 #include "libnm-platform/nm-platform.h"
 #include "settings/nm-settings.h"
 
@@ -199,12 +200,7 @@ static void
 update_connection(NMDevice *device, NMConnection *connection)
 {
     NMDeviceVrfPrivate *priv  = NM_DEVICE_VRF_GET_PRIVATE(device);
-    NMSettingVrf *      s_vrf = _nm_connection_get_setting(connection, NM_TYPE_SETTING_VRF);
-
-    if (!s_vrf) {
-        s_vrf = (NMSettingVrf *) nm_setting_vrf_new();
-        nm_connection_add_setting(connection, (NMSetting *) s_vrf);
-    }
+    NMSettingVrf *      s_vrf = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_VRF);
 
     if (priv->props.table != nm_setting_vrf_get_table(s_vrf))
         g_object_set(G_OBJECT(s_vrf), NM_SETTING_VRF_TABLE, priv->props.table, NULL);