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; );