From ded94e4292c13ea9665e5ef936050000df3e6f39 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 19 May 2020 21:27:12 +0200 Subject: [PATCH] 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. (cherry picked from commit 7ac72f8655b909732f96ff4df6d102d2a3291085) (cherry picked from commit 08a12c683d48bf4b73c3dc39d478b4c1c1c30775) --- src/devices/team/nm-device-team.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index a0749c21f6..c05fe4f54f 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;