team: perform cleanup immediately when connecting to teamd fails

When NM fails to connect to teamd during an activation, it sets the
device state to FAILED. Eventually the device will become DISCONNECTED
and will call the ->deactivate() method that will perform the cleanup
of timers, teamd process and teamdctl instance.

However, in this way, when the device is DISCONNECTED timers are still
armed and can be triggered in the wrong state. Instead, perform the
cleanup immediately on failure.

https://bugzilla.redhat.com/show_bug.cgi?id=1856723
This commit is contained in:
Beniamino Galvani 2020-07-14 22:52:56 +02:00
parent e2fba6c4b3
commit 26e97fcd0d

View file

@ -371,6 +371,7 @@ teamd_ready (NMDeviceTeam *self)
success = teamd_read_config (self);
if (!success) {
teamd_cleanup (self, TRUE);
nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED);
return;
}