Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ofono] Support 3GPP TS 24.301 dual network mode. Fixes JB#56481
The bailout timer fix 6bc974c
introduced a late connection of the network if either of the IP family
configurations was not set yet. This did not account for the situation
properly when either of these IP family configurations are completely
missing according to 3GPP TS 24.301:
 "if the UE requests for PDN type IPv4v6, but the subscription is limited
  to IPv4 only or IPv6 only for the requested APN, the network shall
  override the PDN type requested by the UE to be limited to a single
  address PDN type (IPv4 or IPv6)."

This change affects only dual mode and when the missing IP configuration
is waited for the period set in bailout timer fix the missing one is set
to OFF to avoid disconnection of mobile data. This makes the plugin to
work in dual mode mobile data where operator does not deliver both IP
configurations.

This fixes the issue of looping a cellular connection from
connecting->connected->error->idle->connecting->connected when either of
the IP family types are not sent by the operator or detected by ofono.
  • Loading branch information
LaakkonenJussi committed Dec 8, 2021
1 parent 48e911a commit b9efd7a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions connman/plugins/sailfish_ofono.c
Expand Up @@ -647,6 +647,33 @@ static gboolean modem_is_network_configured(struct modem_data *md)
return TRUE;
}

static void modem_ensure_dual_mode_configuration(struct modem_data *md)
{
bool ipv4_configured;
bool ipv6_configured;

ipv4_configured = connman_network_is_configured(md->network,
CONNMAN_IPCONFIG_TYPE_IPV4);
ipv6_configured = connman_network_is_configured(md->network,
CONNMAN_IPCONFIG_TYPE_IPV6);

/* When both are unconfigured connection must fail */
if (ipv4_configured == ipv6_configured)
return;

if (!ipv4_configured) {
DBG("%p set IPv4 OFF", md);
connman_network_set_ipv4_method(md->network,
CONNMAN_IPCONFIG_METHOD_OFF);
}

if (!ipv6_configured) {
DBG("%p set IPv6 OFF", md);
connman_network_set_ipv6_method(md->network,
CONNMAN_IPCONFIG_METHOD_OFF);
}
}

static gboolean modem_delayed_set_connected(gpointer data)
{
struct modem_data *md = data;
Expand All @@ -665,6 +692,14 @@ static gboolean modem_delayed_set_connected(gpointer data)

DBG("modem %p network %p configured, set connected", md, md->network);

/*
* When we've tried to wait for missing IP configuration in dual mode
* set the missing one OFF to avoid disconnection of mobile data and
* to comply with 3GPP TS 24.301.
*/
if (md->connctx->protocol == OFONO_CONNCTX_PROTOCOL_DUAL)
modem_ensure_dual_mode_configuration(md);

connman_network_set_connected(md->network, TRUE);

md->delayed_set_connected_id = 0;
Expand Down

0 comments on commit b9efd7a

Please sign in to comment.