diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2022-02-03 11:28:53 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2022-02-03 11:30:19 +0100 |
commit | d9c1c10899a1186a28aaf2c7a7f99e54ba53a133 (patch) | |
tree | 373991d93345fc7bdeecb2679a0a9c6d22f46968 | |
parent | 5153810bd64d2e5f75990a6919134b4948de89d8 (diff) |
ovs-port: always remove the OVSDB entry on slave releaselr/ovs-interface-removal
When the link is externally removed, the OVSDB entry will be left
behind. That's not cool -- we need to remove it.
https://bugzilla.redhat.com/show_bug.cgi?id=1935026
-rw-r--r-- | src/core/devices/ovs/nm-device-ovs-port.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c index b0a32b4771..4419cfe96f 100644 --- a/src/core/devices/ovs/nm-device-ovs-port.c +++ b/src/core/devices/ovs/nm-device-ovs-port.c @@ -146,18 +146,23 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure) { NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device); + _LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave)); + + /* Even if the an interface's device has gone away (e.g. externally + * removed and thus we're called with configure=FALSE), we still need + * to make sure its OVSDB entry is gone. + */ + nm_ovsdb_del_interface(nm_ovsdb_get(), + nm_device_get_iface(slave), + del_iface_cb, + g_object_ref(slave)); + if (configure) { - _LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave)); - nm_ovsdb_del_interface(nm_ovsdb_get(), - nm_device_get_iface(slave), - del_iface_cb, - g_object_ref(slave)); /* Open VSwitch is going to delete this one. We must ignore what happens * next with the interface. */ if (NM_IS_DEVICE_OVS_INTERFACE(slave)) nm_device_update_from_platform_link(slave, NULL); - } else - _LOGI(LOGD_DEVICE, "ovs interface %s was released", nm_device_get_ip_iface(slave)); + } } /*****************************************************************************/ |