aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTore Anderson <tore@fud.no>2012-04-13 23:29:17 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-05-06 17:12:36 +0200
commit6b9ee7c83352bb545eab3352b32843a76cde9176 (patch)
tree0b87fd010462daeca5d3c005db7a71382e664ad2 /src
parentcaeeae27219a91384fa41ac5a1e0f21e1edbaa76 (diff)
broadband-bearer: derive PDP type from the ip-type bearer property
This patch makes it possible to use MM to set up PDP contexts with PDP types other than 'IP', which is particularly useful when trying to use the 'IPV6' or 'IPV4V6' PDP types defined in recent 3GPP specs. If ip-type isn't specified, 'IP' will be used by default, due to the fact that modem support for the 'IPV4V6' type is still rather scarce. The patch applies to Aleksander's 'bearer-properties' branch. It has been tested using mmcli in this fashion: mmcli -m 0 --simple-connect=apn=internet # default to 'IP' mmcli -m 0 --simple-connect=apn=internet,ip-type=IP mmcli -m 0 --simple-connect=apn=internet,ip-type=IPV6 mmcli -m 0 --simple-connect=apn=internet,ip-type=IPV4V6
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-bearer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index e7af2772..cf55c7b9 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -758,8 +758,9 @@ find_cid_ready (MMBaseModem *modem,
/* Initialize PDP context with our APN */
ctx->cid = g_variant_get_uint32 (result);
- command = g_strdup_printf ("+CGDCONT=%u,\"IP\",\"%s\"",
+ command = g_strdup_printf ("+CGDCONT=%u,\"%s\",\"%s\"",
ctx->cid,
+ mm_bearer_properties_get_ip_type (mm_bearer_peek_config (MM_BEARER (ctx->self))),
mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self))));
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
@@ -818,8 +819,7 @@ parse_cid_range (MMBaseModem *modem,
pdp_type = g_match_info_fetch (match_info, 3);
- /* TODO: What about PDP contexts of type "IPV6"? */
- if (g_str_equal (pdp_type, "IP")) {
+ if (g_str_equal (pdp_type, mm_bearer_properties_get_ip_type (mm_bearer_peek_config (MM_BEARER (ctx->self))))) {
gchar *max_cid_range_str;
guint max_cid_range;
@@ -905,7 +905,7 @@ parse_pdp_list (MMBaseModem *modem,
pdp->cid,
pdp->pdp_type ? pdp->pdp_type : "",
pdp->apn ? pdp->apn : "");
- if (g_str_equal (pdp->pdp_type, "IP")) {
+ if (g_str_equal (pdp->pdp_type, mm_bearer_properties_get_ip_type (mm_bearer_peek_config (MM_BEARER (ctx->self))))) {
/* PDP with no APN set? we may use that one if not exact match found */
if (!pdp->apn || !pdp->apn[0]) {
mm_dbg ("Found PDP context with CID %u and no APN",
@@ -917,9 +917,9 @@ parse_pdp_list (MMBaseModem *modem,
apn = mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self)));
if (apn &&
g_str_equal (pdp->apn, apn)) {
- /* Found a PDP context with the same CID, we'll use it. */
- mm_dbg ("Found PDP context with CID %u for APN '%s'",
- pdp->cid, pdp->apn);
+ /* Found a PDP context with the same CID and PDP type, we'll use it. */
+ mm_dbg ("Found PDP context with CID %u and PDP type %s for APN '%s'",
+ pdp->cid, pdp->pdp_type, pdp->apn);
cid = pdp->cid;
/* In this case, stop searching */
break;