summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2023-05-04 15:11:49 +0200
committerFernando Fernandez Mancera <ffmancera@riseup.net>2023-05-17 14:08:18 +0200
commitf6f1a44559990765a5cbc940a74f54df5d8a30d0 (patch)
tree71d8a50e902a947f5119a22b7c5d417494de67e8
parentca41be98a075e03e61dc7e898d772792c0a65619 (diff)
downloadNetworkManager-nm-1-40.tar.gz
team: don't try to connect to teamd in update_connection()nm-1-40
In constructed(), NMDevice starts watching the D-Bus name owner or monitoring the unix socket, and so it is always aware if teamd is running. When it is, NMDevice connects to it and initializes priv->tdc. It is not useful to try to connect to teamd in update_connection() because warnings will be generated by NM and by libteam if teamd is not running. As explained above the connection is always initialized when teamd is available, and so we can just check priv->tdc. Fixes: ab586236e36b ('core: implement update_connection() for Team') https://bugzilla.redhat.com/show_bug.cgi?id=2182029 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1631 (cherry picked from commit 93430627c245a0b33b873edca329fa716ccfb7d6) (cherry picked from commit b60f0dd0a20db232c7edc01faa4562ce510ed107)
-rw-r--r--src/core/devices/team/nm-device-team.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/core/devices/team/nm-device-team.c b/src/core/devices/team/nm-device-team.c
index b745158ef8..1d2beb5e8a 100644
--- a/src/core/devices/team/nm-device-team.c
+++ b/src/core/devices/team/nm-device-team.c
@@ -228,17 +228,10 @@ update_connection(NMDevice *device, NMConnection *connection)
NMDeviceTeam *self = NM_DEVICE_TEAM(device);
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;
/* Read the configuration only if not already set */
- if (!priv->config && ensure_teamd_connection(device))
+ if (!priv->config && priv->tdc) {
teamd_read_config(self);
-
- /* Restore previous tdc state */
- if (priv->tdc && !tdc) {
- teamdctl_disconnect(priv->tdc);
- teamdctl_free(priv->tdc);
- priv->tdc = NULL;
}
g_object_set(G_OBJECT(s_team), NM_SETTING_TEAM_CONFIG, _get_config(self), NULL);