diff options
author | goapunk <goapunk@riseup.net> | 2021-05-08 13:23:56 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-05-09 10:42:09 +0200 |
commit | f916d075a78ddacd25e2db9c4eebb99b490482ff (patch) | |
tree | 4d42973b0e47146da6f995403e08717832faa344 /src/mm-modem-helpers-qmi.c | |
parent | ba0701b67d3fc2e6936477bd08440ff36a3878aa (diff) |
modem-helpers-qmi: fix auth validation always returning error
Diffstat (limited to 'src/mm-modem-helpers-qmi.c')
-rw-r--r-- | src/mm-modem-helpers-qmi.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mm-modem-helpers-qmi.c b/src/mm-modem-helpers-qmi.c index e6fc8a9f..13e60810 100644 --- a/src/mm-modem-helpers-qmi.c +++ b/src/mm-modem-helpers-qmi.c @@ -1471,8 +1471,7 @@ mm_bearer_allowed_auth_to_qmi_authentication (MMBearerAllowedAuth auth, gpointer log_object, GError **error) { - QmiWdsAuthentication out; - g_autofree gchar *str = NULL; + QmiWdsAuthentication out; if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) { mm_obj_dbg (log_object, "using default (CHAP) authentication method"); @@ -1490,10 +1489,14 @@ mm_bearer_allowed_auth_to_qmi_authentication (MMBearerAllowedAuth auth, out |= QMI_WDS_AUTHENTICATION_CHAP; /* and if the bitmask cannot be built, error out */ - str = mm_bearer_allowed_auth_build_string_from_mask (auth); - g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, - "Unsupported authentication methods (%s)", - str); + if (out == QMI_WDS_AUTHENTICATION_NONE) { + g_autofree gchar *str = NULL; + + str = mm_bearer_allowed_auth_build_string_from_mask (auth); + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Unsupported authentication methods (%s)", + str); + } return out; } |