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-28 16:55:40 +0100
commit3a55ec63e1295864ecae7f0975796f7793c3b0aa (patch)
tree5742cff26cd64d5a9e322bb6b1c4ed570ae827d4
parentf034f17ff69c52d81589e55ba815404f1ca53b7d (diff)
downloadNetworkManager-3a55ec63e1295864ecae7f0975796f7793c3b0aa.tar.gz
ovs-interface: dissociate the link on disconnection
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 https://github.com/NetworkManager/NetworkManager/pull/324
-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 e3d3f9ee5f..87c4b11f97 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;
}