ovsdb: do not set the device as DEACTIVATING if it is DISCONNECTED

During the deactivation of ovs interfaces, ovsdb receives the command to
remove the interface but for OVS system ports the device won't
disappear.

When reconnecting, ovsdb will update first the status and it will notice
that the OVS system interface was removed and it will set the status as
DEACTIVATING. This is incorrect if the status is already DEACTIVATING,
DISCONNECTED, UNMANAGED or UNAVAILABLE because it will block the
activation of the interface.

https://bugzilla.redhat.com/show_bug.cgi?id=2080236
(cherry picked from commit bc6e28e585)
(cherry picked from commit 19613a8d81)
(cherry picked from commit 45c0cde9eb)
This commit is contained in:
Fernando Fernandez Mancera 2022-05-25 10:07:40 +02:00
parent 631dff08a0
commit 908d508b07

View file

@ -187,7 +187,8 @@ ovsdb_device_removed(NMOvsdb * ovsdb,
device_state = nm_device_get_state(device);
if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE && nm_device_get_act_request(device)
&& device_state < NM_DEVICE_STATE_DEACTIVATING) {
&& (device_state > NM_DEVICE_STATE_DISCONNECTED
&& device_state < NM_DEVICE_STATE_DEACTIVATING)) {
nm_device_state_changed(device,
NM_DEVICE_STATE_DEACTIVATING,
NM_DEVICE_STATE_REASON_REMOVED);