All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix: Username and Password must be set after context is created.
@ 2010-02-01 15:50 sjur.brandeland
  2010-02-01 15:50 ` [PATCH 2/2] Fix: Check if interface exists before creating it sjur.brandeland
  2010-02-01 16:09 ` [PATCH 1/2] Fix: Username and Password must be set after context is created Marcel Holtmann
  0 siblings, 2 replies; 10+ messages in thread
From: sjur.brandeland @ 2010-02-01 15:50 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

From: Sjur Brændeland <sjur.brandeland@stericsson.com>

---
 drivers/stemodem/gprs-context.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c
index 6743aba..c178fb6 100644
--- a/drivers/stemodem/gprs-context.c
+++ b/drivers/stemodem/gprs-context.c
@@ -416,7 +416,7 @@ static void ste_gprs_activate_primary(struct ofono_gprs_context *gc,
 {
 	struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
 	struct cb_data *cbd = cb_data_new(cb, data);
-	char buf[AUTH_BUF_LENGTH];
+	char buf[2*AUTH_BUF_LENGTH];
 	int len;
 
 	if (!cbd)
@@ -425,19 +425,17 @@ static void ste_gprs_activate_primary(struct ofono_gprs_context *gc,
 	gcd->active_context = ctx->cid;
 	cbd->user = gc;
 
-	/* Set username and password */
-	sprintf(buf, "AT*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid,
-		ctx->username, ctx->password);
-
-	if (g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL) == 0)
-		goto error;
-
 	len = sprintf(buf, "AT+CGDCONT=%u,\"IP\"", ctx->cid);
 
 	if (ctx->apn)
 		snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"",
 				ctx->apn);
 
+	/* Set username and password. Must be done after context creation */
+	len = strlen(buf);
+	sprintf(buf+len, ";*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid,
+		ctx->username, ctx->password);
+
 	if (g_at_chat_send(gcd->chat, buf, none_prefix,
 				ste_cgdcont_cb, cbd, g_free) > 0)
 		return;
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-02-01 21:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 15:50 [PATCH 1/2] Fix: Username and Password must be set after context is created sjur.brandeland
2010-02-01 15:50 ` [PATCH 2/2] Fix: Check if interface exists before creating it sjur.brandeland
2010-02-01 16:03   ` Marcel Holtmann
2010-02-01 20:40     ` Sjur =?unknown-8bit?q?Br=C3=A6ndeland?=
2010-02-01 21:40       ` Marcel Holtmann
2010-02-01 16:09 ` [PATCH 1/2] Fix: Username and Password must be set after context is created Marcel Holtmann
2010-02-01 17:23   ` Sjur =?unknown-8bit?q?Br=C3=A6ndeland?=
2010-02-01 19:10     ` Marcel Holtmann
2010-02-01 19:20       ` Denis Kenzior
2010-02-01 21:41         ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.