mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 07:20:11 +01:00
team: set port configuration even if it's empty
Call teamdctl_port_config_update_raw() when we're attaching a port even
if all of team-slave setting properties are default.
This is done to ensure teamd "knows" about the port (that is,
"teamdctl ... port present" returns success) when we're done activating
the slave connection. It will pick it up anyway from netlink, but that
can happen after the activation is done, resulting in a possible race.
Fixes-test: @remove_active_team_profile
https://bugzilla.redhat.com/show_bug.cgi?id=2102375
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1421
(cherry picked from commit 6897f6e6df)
This commit is contained in:
parent
bcf11ebead
commit
0a43082efa
1 changed files with 11 additions and 13 deletions
|
|
@ -865,22 +865,20 @@ attach_port(NMDevice *device,
|
|||
|
||||
s_team_port = nm_connection_get_setting_team_port(connection);
|
||||
if (s_team_port) {
|
||||
const char *config = nm_setting_team_port_get_config(s_team_port);
|
||||
char *sanitized_config;
|
||||
|
||||
if (config) {
|
||||
char *sanitized_config = g_strdup(config);
|
||||
g_strdelimit(sanitized_config, "\r\n", ' ');
|
||||
sanitized_config = g_strdup(nm_setting_team_port_get_config(s_team_port) ?: "{}");
|
||||
g_strdelimit(sanitized_config, "\r\n", ' ');
|
||||
|
||||
g_hash_table_insert(priv->port_configs, g_strdup(port_iface), sanitized_config);
|
||||
g_hash_table_insert(priv->port_configs, g_strdup(port_iface), sanitized_config);
|
||||
|
||||
if (!priv->tdc) {
|
||||
_LOGW(LOGD_TEAM,
|
||||
"attached team port %s config not changed, not connected to teamd",
|
||||
port_iface);
|
||||
} else {
|
||||
if (!_update_port_config(self, port_iface, sanitized_config))
|
||||
return FALSE;
|
||||
}
|
||||
if (!priv->tdc) {
|
||||
_LOGW(LOGD_TEAM,
|
||||
"attached team port %s config not changed, not connected to teamd",
|
||||
port_iface);
|
||||
} else {
|
||||
if (!_update_port_config(self, port_iface, sanitized_config))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
success = nm_platform_link_enslave(nm_device_get_platform(device),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue