diff options
author | Thomas Haller <thaller@redhat.com> | 2014-12-12 17:11:31 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-12-12 18:42:37 +0100 |
commit | 86b6fd01cbcdd235c40ab3bc8128743c11528b81 (patch) | |
tree | a05cf6e5b162d3fcbe551e443e04f71b17a29cd1 | |
parent | 1172178ce659f705987c0840ddf142eab550eb5d (diff) | |
download | NetworkManager-86b6fd01cbcdd235c40ab3bc8128743c11528b81.tar.gz |
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.
-rw-r--r-- | src/devices/team/nm-device-team.c | 11 |
1 files 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 |