mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 07:38:20 +02:00
libnm-glib: fix NMDeviceModem connection compatible check for LTE connections
The 3GPP checks didn't include LTE capabilities, so the modem connection_compatible check would fail for LTE connections with LTE compatible devices.
This commit is contained in:
parent
ee1a43175b
commit
0f5f6da1a5
1 changed files with 6 additions and 2 deletions
|
|
@ -127,6 +127,11 @@ get_type_description (NMDevice *device)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#define MODEM_CAPS_3GPP(caps) (caps & (NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS | \
|
||||
NM_DEVICE_MODEM_CAPABILITY_LTE))
|
||||
|
||||
#define MODEM_CAPS_3GPP2(caps) (caps & (NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO))
|
||||
|
||||
static gboolean
|
||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||
{
|
||||
|
|
@ -156,8 +161,7 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
|||
}
|
||||
|
||||
current_caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
|
||||
if ( !(s_gsm && (current_caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS))
|
||||
&& !(s_cdma && (current_caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO))) {
|
||||
if (!(s_gsm && MODEM_CAPS_3GPP (current_caps)) && !(s_cdma && MODEM_CAPS_3GPP2 (current_caps))) {
|
||||
g_set_error (error, NM_DEVICE_MODEM_ERROR, NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS,
|
||||
"The device missed capabilities required by the GSM/CDMA connection.");
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue