diff options
| author | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-01-13 22:30:39 +0100 |
| commit | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (patch) | |
| tree | 71f32df6617802270e8a78574bd8e1637dc532f4 /src/core/devices/nm-device-macvlan.c | |
| parent | e74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff) | |
New upstream version 1.34.0 upstream/1.34.0
Diffstat (limited to 'src/core/devices/nm-device-macvlan.c')
| -rw-r--r-- | src/core/devices/nm-device-macvlan.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/devices/nm-device-macvlan.c b/src/core/devices/nm-device-macvlan.c index 7302ecdf..937ba9e4 100644 --- a/src/core/devices/nm-device-macvlan.c +++ b/src/core/devices/nm-device-macvlan.c @@ -13,6 +13,7 @@ #include "settings/nm-settings.h" #include "nm-act-request.h" #include "nm-manager.h" +#include "libnm-core-aux-intern/nm-libnm-core-utils.h" #include "libnm-platform/nm-platform.h" #include "nm-device-factory.h" #include "nm-setting-macvlan.h" @@ -419,14 +420,10 @@ complete_connection(NMDevice * device, static void update_connection(NMDevice *device, NMConnection *connection) { - NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(device); - NMSettingMacvlan * s_macvlan = nm_connection_get_setting_macvlan(connection); - int new_mode; - - if (!s_macvlan) { - s_macvlan = (NMSettingMacvlan *) nm_setting_macvlan_new(); - nm_connection_add_setting(connection, (NMSetting *) s_macvlan); - } + NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE(device); + NMSettingMacvlan * s_macvlan = + _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_MACVLAN); + int new_mode; new_mode = platform_mode_to_setting(priv->props.mode); if (new_mode != nm_setting_macvlan_get_mode(s_macvlan)) |