From 48695df0233a310f883ab2bf23b496b5b8b6569c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 4 Jan 2016 11:57:22 +0100 Subject: [PATCH] vlan: make connection available if the device is not real Otherwise NMDevice would do and always fail a carrier check, making it impossible to ever manually activate a vlan connection. --- src/devices/nm-device-vlan.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index 9f37cafb6f..8e79ce7ef5 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -432,6 +432,18 @@ check_connection_compatible (NMDevice *device, NMConnection *connection) return TRUE; } +static gboolean +check_connection_available (NMDevice *device, + NMConnection *connection, + NMDeviceCheckConAvailableFlags flags, + const char *specific_object) +{ + if (!nm_device_is_real (device)) + return TRUE; + + return NM_DEVICE_CLASS (nm_device_vlan_parent_class)->check_connection_available (device, connection, flags, specific_object); +} + static gboolean complete_connection (NMDevice *device, NMConnection *connection, @@ -691,6 +703,7 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass) parent_class->notify_new_device_added = notify_new_device_added; parent_class->check_connection_compatible = check_connection_compatible; + parent_class->check_connection_available = check_connection_available; parent_class->complete_connection = complete_connection; parent_class->update_connection = update_connection;