ovs-port: dissociate the link from the interface device on delete

Open vSwitch is the special kid on the block -- it likes to be in charge of
the link lifetime and so we shouldn't be. This means that we shouldn't be
attempting to remove the link: we'd just (gracefully) fail anyways.

More importantly, this also means that we shouldn't care if we see the link
go away. We may already be activating another connection and shouldn't alter
the device state when OpenVSwitch decides to drop the old link.

https://bugzilla.redhat.com/show_bug.cgi?id=1543557
https://github.com/NetworkManager/NetworkManager/pull/315
This commit is contained in:
Lubomir Rintel 2019-03-12 15:50:47 +01:00
parent 89713ebfdf
commit ee39f3ab79

View file

@ -139,6 +139,13 @@ del_iface_cb (GError *error, gpointer user_data)
static void
release_slave (NMDevice *device, NMDevice *slave, gboolean configure)
{
/* Dissociate the platform link from the device -- openvswitch is going
* to remove the link, not us. We shouldn't care about whatever happen to it.
* In particular, we don't want to alter the NMDevice state if we see the
* link go away, because the device may already have another activation
* enqueued. */
nm_device_update_from_platform_link (slave, NULL);
nm_ovsdb_del_interface (nm_ovsdb_get (), nm_device_get_iface (slave),
del_iface_cb, g_object_ref (slave));
}