From e74c568b07b50b97873fb4ee1d776dedefbd54d6 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 1 Oct 2021 23:05:04 +0200 Subject: New upstream version 1.32.12 --- src/core/devices/team/meson.build | 1 - src/core/devices/team/nm-device-team.c | 32 ++++++++++++++------------------ src/core/devices/team/nm-team-factory.c | 4 ++-- 3 files changed, 16 insertions(+), 21 deletions(-) (limited to 'src/core/devices/team') diff --git a/src/core/devices/team/meson.build b/src/core/devices/team/meson.build index d0ff4caa..b1ee9103 100644 --- a/src/core/devices/team/meson.build +++ b/src/core/devices/team/meson.build @@ -11,7 +11,6 @@ libnm_device_plugin_team = shared_module( jansson_dep, libteamdctl_dep, ], - c_args: daemon_c_flags, link_args: ldflags_linker_script_devices, link_depends: linker_script_devices, install: true, diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c index d2d71729..0f1a8c4c 100644 --- a/src/core/devices/team/nm-device-team.c +++ b/src/core/devices/team/nm-device-team.c @@ -15,15 +15,15 @@ #include #include -#include "nm-glib-aux/nm-jansson.h" +#include "libnm-glib-aux/nm-jansson.h" #include "NetworkManagerUtils.h" #include "devices/nm-device-private.h" -#include "platform/nm-platform.h" +#include "libnm-platform/nm-platform.h" #include "nm-config.h" -#include "nm-core-internal.h" +#include "libnm-core-intern/nm-core-internal.h" #include "nm-dbus-manager.h" #include "nm-ip4-config.h" -#include "nm-std-aux/nm-dbus-compat.h" +#include "libnm-std-aux/nm-dbus-compat.h" #define _NMLOG_DEVICE_TYPE NMDeviceTeam #include "devices/nm-device-logging.h" @@ -829,12 +829,12 @@ enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gbool "enslaved team port %s config not changed, not connected to teamd", slave_iface); } else { - int err; - char *sanitized_config; + gs_free char *sanitized_config = NULL; + int err; - sanitized_config = g_strdelimit(g_strdup(config), "\r\n", ' '); + sanitized_config = g_strdup(config); + g_strdelimit(sanitized_config, "\r\n", ' '); err = teamdctl_port_config_update_raw(priv->tdc, slave_iface, sanitized_config); - g_free(sanitized_config); if (err != 0) { _LOGE(LOGD_TEAM, "failed to update config for port %s (err=%d)", @@ -1042,17 +1042,13 @@ dispose(GObject *object) static const NMDBusInterfaceInfoExtended interface_info_device_team = { .parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT( NM_DBUS_INTERFACE_DEVICE_TEAM, - .signals = NM_DEFINE_GDBUS_SIGNAL_INFOS(&nm_signal_info_property_changed_legacy, ), .properties = NM_DEFINE_GDBUS_PROPERTY_INFOS( - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L("HwAddress", - "s", - NM_DEVICE_HW_ADDRESS), - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L("Carrier", "b", NM_DEVICE_CARRIER), - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L("Slaves", "ao", NM_DEVICE_SLAVES), - NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L("Config", - "s", - NM_DEVICE_TEAM_CONFIG), ), ), - .legacy_property_changed = TRUE, + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("HwAddress", "s", NM_DEVICE_HW_ADDRESS), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Carrier", "b", NM_DEVICE_CARRIER), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Slaves", "ao", NM_DEVICE_SLAVES), + NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE("Config", + "s", + NM_DEVICE_TEAM_CONFIG), ), ), }; static void diff --git a/src/core/devices/team/nm-team-factory.c b/src/core/devices/team/nm-team-factory.c index 57b51bf8..e2040d19 100644 --- a/src/core/devices/team/nm-team-factory.c +++ b/src/core/devices/team/nm-team-factory.c @@ -10,8 +10,8 @@ #include "nm-manager.h" #include "devices/nm-device-factory.h" #include "nm-device-team.h" -#include "platform/nm-platform.h" -#include "nm-core-internal.h" +#include "libnm-platform/nm-platform.h" +#include "libnm-core-intern/nm-core-internal.h" /*****************************************************************************/ -- cgit 1.3.0-6-gf8a5 From 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 13 Jan 2022 22:30:39 +0100 Subject: New upstream version 1.34.0 --- src/core/devices/team/nm-device-team.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'src/core/devices/team') diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c index 0f1a8c4c..3398e467 100644 --- a/src/core/devices/team/nm-device-team.c +++ b/src/core/devices/team/nm-device-team.c @@ -20,6 +20,7 @@ #include "devices/nm-device-private.h" #include "libnm-platform/nm-platform.h" #include "nm-config.h" +#include "libnm-core-aux-intern/nm-libnm-core-utils.h" #include "libnm-core-intern/nm-core-internal.h" #include "nm-dbus-manager.h" #include "nm-ip4-config.h" @@ -78,8 +79,6 @@ complete_connection(NMDevice * device, NMConnection *const *existing_connections, GError ** error) { - NMSettingTeam *s_team; - nm_utils_complete_generic(nm_device_get_platform(device), connection, NM_SETTING_TEAM_SETTING_NAME, @@ -90,11 +89,7 @@ complete_connection(NMDevice * device, NULL, TRUE); - s_team = nm_connection_get_setting_team(connection); - if (!s_team) { - s_team = (NMSettingTeam *) nm_setting_team_new(); - nm_connection_add_setting(connection, NM_SETTING(s_team)); - } + _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_TEAM); return TRUE; } @@ -168,15 +163,10 @@ static void update_connection(NMDevice *device, NMConnection *connection) { NMDeviceTeam * self = NM_DEVICE_TEAM(device); - NMSettingTeam * s_team = nm_connection_get_setting_team(connection); + NMSettingTeam * s_team = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_TEAM); NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE(self); struct teamdctl * tdc = priv->tdc; - if (!s_team) { - s_team = (NMSettingTeam *) nm_setting_team_new(); - nm_connection_add_setting(connection, (NMSetting *) s_team); - } - /* Read the configuration only if not already set */ if (!priv->config && ensure_teamd_connection(device)) teamd_read_config(self); @@ -250,11 +240,7 @@ master_update_slave_connection(NMDevice * self, return FALSE; } - s_port = nm_connection_get_setting_team_port(connection); - if (!s_port) { - s_port = (NMSettingTeamPort *) nm_setting_team_port_new(); - nm_connection_add_setting(connection, NM_SETTING(s_port)); - } + s_port = _nm_connection_ensure_setting(connection, NM_TYPE_SETTING_TEAM_PORT); g_object_set(G_OBJECT(s_port), NM_SETTING_TEAM_PORT_CONFIG, port_config, NULL); g_free(port_config); -- cgit 1.3.0-6-gf8a5