aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-11-01 15:44:18 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-11-01 15:50:12 +0100
commit1b3114a0f9ca28273e1446535b73d5b83c54c6cf (patch)
tree65de3b859136c0ec27f3ff0501665aac6e025053 /src/mm-modem-helpers.c
parent04b52d590f9c47316e8eca9eeccb8084991f2f55 (diff)
modem-helpers: handle +CGDCONT=? replies with single context
https://bugzilla.gnome.org/show_bug.cgi?id=708983
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 9c86ebc2..a295dc3e 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -764,7 +764,7 @@ mm_3gpp_parse_cgdcont_test_response (const gchar *response,
return NULL;
}
- r = g_regex_new ("\\+CGDCONT:\\s*\\((\\d+)-(\\d+)\\),\\(?\"(\\S+)\"",
+ r = g_regex_new ("\\+CGDCONT:\\s*\\((\\d+)-?(\\d+)?\\),\\(?\"(\\S+)\"",
G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW,
0, &inner_error);
g_assert (r != NULL);
@@ -786,19 +786,18 @@ mm_3gpp_parse_cgdcont_test_response (const gchar *response,
if (!mm_get_uint_from_match_info (match_info, 1, &min_cid))
mm_warn ("Invalid min CID in CGDCONT=? reply for PDP type '%s'", pdp_type_str);
else {
- /* Read max CID */
+ MM3gppPdpContextFormat *format;
+
+ /* Read max CID: Optional! If no value given, we default to min CID */
if (!mm_get_uint_from_match_info (match_info, 2, &max_cid))
- mm_warn ("Invalid max CID in CGDCONT=? reply for PDP type '%s'", pdp_type_str);
- else {
- MM3gppPdpContextFormat *format;
+ max_cid = min_cid;
- format = g_slice_new (MM3gppPdpContextFormat);
- format->pdp_type = pdp_type;
- format->min_cid = min_cid;
- format->max_cid = max_cid;
+ format = g_slice_new (MM3gppPdpContextFormat);
+ format->pdp_type = pdp_type;
+ format->min_cid = min_cid;
+ format->max_cid = max_cid;
- list = g_list_prepend (list, format);
- }
+ list = g_list_prepend (list, format);
}
}