summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-06-30 17:51:04 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-08-05 08:03:16 +0200
commita7afa9ead7e8ca53d269ee69284056889f072281 (patch)
tree7db3c77d077a2c46710e0ebd6773eb395e86b4aa
parent6c3195931e94cab70208ce97f3b834f5d9f5ff62 (diff)
downloadNetworkManager-a7afa9ead7e8ca53d269ee69284056889f072281.tar.gz
device: use ppp device for new style pppoe setting
-rw-r--r--libnm-core/nm-connection.c7
-rw-r--r--src/devices/nm-device-ethernet.c16
2 files changed, 23 insertions, 0 deletions
diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c
index e41e6b6662..d2e528420e 100644
--- a/libnm-core/nm-connection.c
+++ b/libnm-core/nm-connection.c
@@ -1952,6 +1952,13 @@ nm_connection_is_virtual (NMConnection *connection)
if (nm_streq (type, NM_SETTING_BLUETOOTH_SETTING_NAME))
return !!_nm_connection_get_setting_bluetooth_for_nap (connection);
+ if (nm_streq (type, NM_SETTING_PPPOE_SETTING_NAME)) {
+ NMSettingPppoe *s_pppoe;
+
+ s_pppoe = nm_connection_get_setting_pppoe (connection);
+ return !!nm_setting_pppoe_get_parent (s_pppoe);
+ }
+
return FALSE;
}
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index 83dc984dcc..eaa6a1f85d 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -1796,8 +1796,24 @@ create_device (NMDeviceFactory *factory,
NULL);
}
+static gboolean
+match_connection (NMDeviceFactory *factory, NMConnection *connection)
+{
+ const char *type = nm_connection_get_connection_type (connection);
+ NMSettingPppoe *s_pppoe;
+
+ if (nm_streq (type, NM_SETTING_WIRED_SETTING_NAME))
+ return TRUE;
+
+ nm_assert (nm_streq (type, NM_SETTING_PPPOE_SETTING_NAME));
+ s_pppoe = nm_connection_get_setting_pppoe (connection);
+
+ return !nm_setting_pppoe_get_parent (s_pppoe);
+}
+
NM_DEVICE_FACTORY_DEFINE_INTERNAL (ETHERNET, Ethernet, ethernet,
NM_DEVICE_FACTORY_DECLARE_LINK_TYPES (NM_LINK_TYPE_ETHERNET)
NM_DEVICE_FACTORY_DECLARE_SETTING_TYPES (NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_PPPOE_SETTING_NAME),
factory_class->create_device = create_device;
+ factory_class->match_connection = match_connection;
);