summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-02-22 16:18:40 +0100
committerFernando Fernandez Mancera <ffmancera@riseup.net>2022-03-04 10:31:07 +0100
commit65fdfb25006acc3c67059792579dd7a770d04768 (patch)
treecb5eca088e51b9c2f14553ffedd76d8b8c7ebb83
parenta5f2285aeca3d57371f833e1360febcfc8811a89 (diff)
downloadNetworkManager-65fdfb25006acc3c67059792579dd7a770d04768.tar.gz
ovs-port: fix removal of ovsdb entry if the interface goes away
Hope third time is the charm. The idea here is to remove the OVSDB entry if the device actually went away violently (like, the it was actually removed from the platform), but keep it if we're shutting down. Fixes-test: @ovs_nmstate Fixes: 966413e78f14 ('ovs-port: avoid removing the OVSDB entry if we're shutting down') Fixes: ecc73eb239e6 ('ovs-port: always remove the OVSDB entry on slave release') https://bugzilla.redhat.com/show_bug.cgi?id=2055665
-rw-r--r--src/core/devices/ovs/nm-device-ovs-port.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c
index 8406c3648c..116f58c43a 100644
--- a/src/core/devices/ovs/nm-device-ovs-port.c
+++ b/src/core/devices/ovs/nm-device-ovs-port.c
@@ -188,8 +188,10 @@ del_iface_cb(GError *error, gpointer user_data)
static void
release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
{
- NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device);
- bool slave_removed = nm_device_sys_iface_state_get(slave) == NM_DEVICE_SYS_IFACE_STATE_REMOVED;
+ NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device);
+ bool slave_not_managed = !NM_IN_SET(nm_device_sys_iface_state_get(slave),
+ NM_DEVICE_SYS_IFACE_STATE_MANAGED,
+ NM_DEVICE_SYS_IFACE_STATE_ASSUME);
_LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave));
@@ -197,7 +199,7 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
* removed and thus we're called with configure=FALSE), we still need
* to make sure its OVSDB entry is gone.
*/
- if (configure || slave_removed) {
+ if (configure || slave_not_managed) {
nm_ovsdb_del_interface(nm_ovsdb_get(),
nm_device_get_iface(slave),
del_iface_cb,