From 86b6fd01cbcdd235c40ab3bc8128743c11528b81 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 12 Dec 2014 17:11:31 +0100 Subject: team: only proceed with stage2 when team device is STATE_PREPARE The team device might already be in a different state because activation failed. In this case, we don't want to proceed with stage2. --- src/devices/team/nm-device-team.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 3c949258c0..16f1fcc2a5 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -330,16 +330,21 @@ teamd_dbus_appeared (GDBusConnection *connection, NMDeviceTeam *self = NM_DEVICE_TEAM (user_data); NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (self); NMDevice *device = NM_DEVICE (self); + gboolean success; g_return_if_fail (priv->teamd_dbus_watch); _LOGI (LOGD_TEAM, "teamd appeared on D-Bus"); teamd_timeout_remove (device); - if (!ensure_teamd_connection (device)) { - nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED); + + success = ensure_teamd_connection (device); + if (nm_device_get_state (device) == NM_DEVICE_STATE_PREPARE) { + if (success) + nm_device_activate_schedule_stage2_device_config (device); + else if (!nm_device_uses_assumed_connection (device)) + nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED); return; } - nm_device_activate_schedule_stage2_device_config (device); } static void -- cgit v1.2.1