summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-03-12 15:50:47 +0100
committerLubomir Rintel <lkundrak@v3.sk>2019-03-27 20:09:55 +0100
commit46cdb047582fd5e3cba30f18b9feabb2f9c36b40 (patch)
tree29d34b2cc7653268ecafd6bda99ae4fec6f048f1
parent8f2a8a52f0d1f8d82409cc044413629adfd454ab (diff)
ovs-interface: dissociate the link on disconnectionlr/ovs-interface-plink
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. Once the device reaches DISCONNECTED state, its configuration is cleaned up and we may already be activating another connection. We shouldn't alter the device state when OpenVSwitch decides to drop the old link. https://bugzilla.redhat.com/show_bug.cgi?id=1543557
-rw-r--r--src/devices/ovs/nm-device-ovs-interface.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/devices/ovs/nm-device-ovs-interface.c b/src/devices/ovs/nm-device-ovs-interface.c
index e3d3f9ee5..87c4b11f9 100644
--- a/src/devices/ovs/nm-device-ovs-interface.c
+++ b/src/devices/ovs/nm-device-ovs-interface.c
@@ -118,6 +118,16 @@ link_changed (NMDevice *device,
}
}
+static void
+state_changed (NMDevice *device,
+ NMDeviceState new_state,
+ NMDeviceState old_state,
+ NMDeviceStateReason reason)
+{
+ if (new_state <= NM_DEVICE_STATE_DISCONNECTED)
+ nm_device_update_from_platform_link (device, NULL);
+}
+
static gboolean
_is_internal_interface (NMDevice *device)
{
@@ -190,6 +200,7 @@ nm_device_ovs_interface_class_init (NMDeviceOvsInterfaceClass *klass)
device_class->is_available = is_available;
device_class->check_connection_compatible = check_connection_compatible;
device_class->link_changed = link_changed;
+ device_class->state_changed = state_changed;
device_class->act_stage3_ip_config_start = act_stage3_ip_config_start;
device_class->can_unmanaged_external_down = can_unmanaged_external_down;
}