summaryrefslogtreecommitdiff
path: root/drivers/ifxmodem
diff options
context:
space:
mode:
authorGiacinto Cifelli <gciofono@gmail.com>2018-10-06 07:45:20 +0200
committerDenis Kenzior <denkenz@gmail.com>2018-10-09 12:35:44 -0500
commitbd6f807849c4be4f430e499c8c36d03d00f8c48d (patch)
tree7b8d115a70688feb2d9e41916334fa4503aa8c77 /drivers/ifxmodem
parenta5bdf48ca7be70a9b33a47dae0ea03bf842efdd2 (diff)
downloadofono-bd6f807849c4be4f430e499c8c36d03d00f8c48d.tar.gz
drivers: support for auth NONE
Added the explicit support for auth NONE. It needs to be added in all drivers/*/gprs-context.c atoms. This method is already supported by all atoms that support authentication (ie, all but Sierra' swmodem driver). The behavior is left unchanged in case of inconsistent parameters: if username is empty, then fallback to auth NONE.
Diffstat (limited to 'drivers/ifxmodem')
-rw-r--r--drivers/ifxmodem/gprs-context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/ifxmodem/gprs-context.c b/drivers/ifxmodem/gprs-context.c
index 885e41bb..289b4341 100644
--- a/drivers/ifxmodem/gprs-context.c
+++ b/drivers/ifxmodem/gprs-context.c
@@ -466,8 +466,14 @@ static void ifx_gprs_activate_primary(struct ofono_gprs_context *gc,
gcd->active_context = ctx->cid;
gcd->cb = cb;
gcd->cb_data = data;
- memcpy(gcd->username, ctx->username, sizeof(ctx->username));
- memcpy(gcd->password, ctx->password, sizeof(ctx->password));
+
+ if (ctx->auth_method == OFONO_GPRS_AUTH_METHOD_NONE) {
+ memset(gcd->username, 0, sizeof(gcd->username));
+ memset(gcd->password, 0, sizeof(gcd->password));
+ } else {
+ memcpy(gcd->username, ctx->username, sizeof(ctx->username));
+ memcpy(gcd->password, ctx->password, sizeof(ctx->password));
+ }
gcd->state = STATE_ENABLING;
gcd->proto = ctx->proto;