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 7ac72f8655)
(cherry picked from commit 08a12c683d)
This commit is contained in:
Beniamino Galvani 2020-05-19 21:27:12 +02:00 committed by Thomas Haller
parent 759283c676
commit ded94e4292
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;