mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 10:30:04 +01:00
ovs-port: always remove the OVSDB entry on slave release
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 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1084
This commit is contained in:
parent
405afad0a6
commit
ecc73eb239
1 changed files with 12 additions and 7 deletions
|
|
@ -146,18 +146,23 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure)
|
||||||
{
|
{
|
||||||
NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device);
|
NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device);
|
||||||
|
|
||||||
if (configure) {
|
|
||||||
_LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave));
|
_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_ovsdb_del_interface(nm_ovsdb_get(),
|
||||||
nm_device_get_iface(slave),
|
nm_device_get_iface(slave),
|
||||||
del_iface_cb,
|
del_iface_cb,
|
||||||
g_object_ref(slave));
|
g_object_ref(slave));
|
||||||
|
|
||||||
|
if (configure) {
|
||||||
/* Open VSwitch is going to delete this one. We must ignore what happens
|
/* Open VSwitch is going to delete this one. We must ignore what happens
|
||||||
* next with the interface. */
|
* next with the interface. */
|
||||||
if (NM_IS_DEVICE_OVS_INTERFACE(slave))
|
if (NM_IS_DEVICE_OVS_INTERFACE(slave))
|
||||||
nm_device_update_from_platform_link(slave, NULL);
|
nm_device_update_from_platform_link(slave, NULL);
|
||||||
} else
|
}
|
||||||
_LOGI(LOGD_DEVICE, "ovs interface %s was released", nm_device_get_ip_iface(slave));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue