summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-12-11 11:54:08 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-12-14 21:02:31 +0100
commit0738c1044524b938f008c111b829db7dabbb8269 (patch)
tree628597661c747e536462c51a71ada02026636651
parentbd9b253540ae283af8f1e6651a7b2a095b1533d4 (diff)
downloadNetworkManager-0738c1044524b938f008c111b829db7dabbb8269.tar.gz
ovs: check state before starting ip configuration after link change
When the link becomes available, check that the device is in the ip-config state before starting ip configuration. Also, reset the 'waiting_for_interface' flag when the device deactivates. https://bugzilla.redhat.com/show_bug.cgi?id=1781165 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/358
-rw-r--r--src/devices/ovs/nm-device-ovs-interface.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/devices/ovs/nm-device-ovs-interface.c b/src/devices/ovs/nm-device-ovs-interface.c
index 4cbb0cd1ff..726e990131 100644
--- a/src/devices/ovs/nm-device-ovs-interface.c
+++ b/src/devices/ovs/nm-device-ovs-interface.c
@@ -98,7 +98,9 @@ link_changed (NMDevice *device,
{
NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE (device);
- if (pllink && priv->waiting_for_interface) {
+ if ( pllink
+ && priv->waiting_for_interface
+ && nm_device_get_state (device) == NM_DEVICE_STATE_IP_CONFIG) {
priv->waiting_for_interface = FALSE;
nm_device_bring_up (device, TRUE, NULL);
nm_device_activate_schedule_stage3_ip_config_start (device);
@@ -142,6 +144,15 @@ can_unmanaged_external_down (NMDevice *self)
return FALSE;
}
+static void
+deactivate (NMDevice *device)
+{
+ NMDeviceOvsInterface *self = NM_DEVICE_OVS_INTERFACE (device);
+ NMDeviceOvsInterfacePrivate *priv = NM_DEVICE_OVS_INTERFACE_GET_PRIVATE (self);
+
+ priv->waiting_for_interface = FALSE;
+}
+
/*****************************************************************************/
static void
@@ -171,6 +182,7 @@ nm_device_ovs_interface_class_init (NMDeviceOvsInterfaceClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_OVS_INTERFACE_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (NM_LINK_TYPE_OPENVSWITCH);
+ device_class->deactivate = deactivate;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;