diff -ur a/plugins/huawei/mm-broadband-bearer-huawei.c b/plugins/huawei/mm-broadband-bearer-huawei.c --- a/plugins/huawei/mm-broadband-bearer-huawei.c +++ b/plugins/huawei/mm-broadband-bearer-huawei.c @@ -256,13 +259,26 @@ user = mm_bearer_properties_get_user (mm_bearer_peek_config (MM_BEARER (ctx->self))); passwd = mm_bearer_properties_get_password (mm_bearer_peek_config (MM_BEARER (ctx->self))); auth = mm_bearer_properties_get_allowed_auth (mm_bearer_peek_config (MM_BEARER (ctx->self))); - encoded_auth = huawei_parse_auth_type (auth); + + /* Default to no authentication if not specified */ + if ((encoded_auth = huawei_parse_auth_type (auth)) == MM_BEARER_HUAWEI_AUTH_UNKNOWN) { + encoded_auth = MM_BEARER_HUAWEI_AUTH_NONE; + } - command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\",\"%s\",\"%s\",%d", - apn == NULL ? "" : apn, - user == NULL ? "" : user, - passwd == NULL ? "" : passwd, - encoded_auth == MM_BEARER_HUAWEI_AUTH_UNKNOWN ? MM_BEARER_HUAWEI_AUTH_NONE : encoded_auth); + if (!user && !passwd) { + command = g_strdup ("AT^NDISDUP=1,1"); + } else if (encoded_auth == MM_BEARER_HUAWEI_AUTH_NONE) { + command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\",\"%s\",\"%s\"", + apn == NULL ? "" : apn, + user == NULL ? "" : user, + passwd == NULL ? "" : passwd); + } else { + command = g_strdup_printf ("AT^NDISDUP=1,1,\"%s\",\"%s\",\"%s\",%d", + apn == NULL ? "" : apn, + user == NULL ? "" : user, + passwd == NULL ? "" : passwd, + encoded_auth); + } mm_base_modem_at_command_full (ctx->modem, ctx->primary, command,