mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-22 02:10:41 +01:00
device: use ppp device for new style pppoe setting
This commit is contained in:
parent
6c3195931e
commit
a7afa9ead7
2 changed files with 23 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue