summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-05-19 21:27:12 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2020-05-28 18:31:38 +0200
commit7ac72f8655b909732f96ff4df6d102d2a3291085 (patch)
tree499697be248cf22d6f7b97ba0b1d4247ae392c76
parent266d054808df2ac3a779f83dd5a00d264345c99f (diff)
downloadNetworkManager-7ac72f8655b909732f96ff4df6d102d2a3291085.tar.gz
team: ensure that teamd is running for assumed devices
When a team device is assumed, we skip stage1 and imply that teamd is already running. If this doesn't happen (for example because teamd was manually stopped or because the interface was created in the initrd), the team interface will continue processing traffic but will not react to changes in the environment (e.g. carrier changes). Ensure that teamd is running for assumed devices.
-rw-r--r--src/devices/team/nm-device-team.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index 06f8840d4a..f52fe3dbdc 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -651,6 +651,14 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *out_failure_reason)
NMSettingTeam *s_team;
const char *cfg;
+ if (nm_device_sys_iface_state_is_external (device))
+ return NM_ACT_STAGE_RETURN_SUCCESS;
+
+ if (nm_device_sys_iface_state_is_external_or_assume (device)) {
+ if (ensure_teamd_connection (device))
+ return NM_ACT_STAGE_RETURN_SUCCESS;
+ }
+
s_team = nm_device_get_applied_setting (device, NM_TYPE_SETTING_TEAM);
if (!s_team)
g_return_val_if_reached (NM_ACT_STAGE_RETURN_FAILURE);
@@ -977,6 +985,7 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
device_class->update_connection = update_connection;
device_class->master_update_slave_connection = master_update_slave_connection;
+ device_class->act_stage1_prepare_also_for_external_or_assume = TRUE;
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
device_class->deactivate = deactivate;