diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-27 15:16:50 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-29 17:26:47 +0200 |
commit | ea7edbbf9e3de5f3cd1c4c0ed335a0f5504f0edc (patch) | |
tree | 2030575eae0fc4952d27ddd0394fcbc40cf4ab1a /src | |
parent | fb932268587bb59e5700e93a52c72e619e150b27 (diff) |
bearer-qmi: only specify IP family preference TLV if one explicitly requested
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-bearer-qmi.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index 3b3ed894..7e63e81c 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -82,6 +82,7 @@ typedef struct { gchar *user; gchar *password; gchar *apn; + gboolean no_ip_family_preference; gboolean ipv4; gboolean running_ipv4; @@ -234,10 +235,15 @@ build_start_network_input (ConnectContext *ctx) if (ctx->password) qmi_message_wds_start_network_input_set_password (input, ctx->password, NULL); - qmi_message_wds_start_network_input_set_ip_family_preference ( - input, - (ctx->running_ipv6 ? QMI_WDS_IP_FAMILY_IPV6 : QMI_WDS_IP_FAMILY_IPV4), - NULL); + /* Only add the IP family preference TLV if explicitly requested a given + * family. This TLV may be newer than the Start Network command itself, so + * we'll just allow the case where none is specified */ + if (!ctx->no_ip_family_preference) { + qmi_message_wds_start_network_input_set_ip_family_preference ( + input, + (ctx->running_ipv6 ? QMI_WDS_IP_FAMILY_IPV6 : QMI_WDS_IP_FAMILY_IPV4), + NULL); + } return input; } @@ -583,6 +589,7 @@ connect (MMBearer *self, case MM_BEARER_IP_FAMILY_UNKNOWN: default: mm_dbg ("No specific IP family requested, defaulting to IPv4"); + ctx->no_ip_family_preference = TRUE; ctx->ipv4 = TRUE; ctx->ipv6 = FALSE; break; |