bearer-qmi: fix dual-stack connections

Connecting the second family of a dual stack connections fails with
'PolicyMismatch' when muxing is setup after family selection.

Switching the order of the family selection and muxing setup to
fix the problem. Looks like family selection must be the very last
WDS request before connecting the client.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
This commit is contained in:
Bjørn Mork
2021-04-23 19:37:13 +02:00
parent f170950451
commit 1c6258056e

View File

@@ -421,15 +421,15 @@ typedef enum {
CONNECT_STEP_IP_METHOD, CONNECT_STEP_IP_METHOD,
CONNECT_STEP_IPV4, CONNECT_STEP_IPV4,
CONNECT_STEP_WDS_CLIENT_IPV4, CONNECT_STEP_WDS_CLIENT_IPV4,
CONNECT_STEP_IP_FAMILY_IPV4,
CONNECT_STEP_BIND_DATA_PORT_IPV4, CONNECT_STEP_BIND_DATA_PORT_IPV4,
CONNECT_STEP_IP_FAMILY_IPV4,
CONNECT_STEP_ENABLE_INDICATIONS_IPV4, CONNECT_STEP_ENABLE_INDICATIONS_IPV4,
CONNECT_STEP_START_NETWORK_IPV4, CONNECT_STEP_START_NETWORK_IPV4,
CONNECT_STEP_GET_CURRENT_SETTINGS_IPV4, CONNECT_STEP_GET_CURRENT_SETTINGS_IPV4,
CONNECT_STEP_IPV6, CONNECT_STEP_IPV6,
CONNECT_STEP_WDS_CLIENT_IPV6, CONNECT_STEP_WDS_CLIENT_IPV6,
CONNECT_STEP_IP_FAMILY_IPV6,
CONNECT_STEP_BIND_DATA_PORT_IPV6, CONNECT_STEP_BIND_DATA_PORT_IPV6,
CONNECT_STEP_IP_FAMILY_IPV6,
CONNECT_STEP_ENABLE_INDICATIONS_IPV6, CONNECT_STEP_ENABLE_INDICATIONS_IPV6,
CONNECT_STEP_START_NETWORK_IPV6, CONNECT_STEP_START_NETWORK_IPV6,
CONNECT_STEP_GET_CURRENT_SETTINGS_IPV6, CONNECT_STEP_GET_CURRENT_SETTINGS_IPV6,
@@ -1637,27 +1637,6 @@ connect_context_step (GTask *task)
ctx->step++; ctx->step++;
} /* fall through */ } /* fall through */
case CONNECT_STEP_IP_FAMILY_IPV4:
/* If client is new enough, select IP family */
if (!ctx->no_ip_family_preference) {
QmiMessageWdsSetIpFamilyInput *input;
mm_obj_dbg (self, "setting default IP family to: IPv4");
input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv4,
input,
10,
g_task_get_cancellable (task),
(GAsyncReadyCallback)set_ip_family_ready,
task);
qmi_message_wds_set_ip_family_input_unref (input);
return;
}
ctx->step++;
/* fall through */
case CONNECT_STEP_BIND_DATA_PORT_IPV4: case CONNECT_STEP_BIND_DATA_PORT_IPV4:
/* If SIO port given, bind client to it */ /* If SIO port given, bind client to it */
if (ctx->sio_port != QMI_SIO_PORT_NONE) { if (ctx->sio_port != QMI_SIO_PORT_NONE) {
@@ -1700,6 +1679,27 @@ connect_context_step (GTask *task)
ctx->step++; ctx->step++;
/* fall through */ /* fall through */
case CONNECT_STEP_IP_FAMILY_IPV4:
/* If client is new enough, select IP family */
if (!ctx->no_ip_family_preference) {
QmiMessageWdsSetIpFamilyInput *input;
mm_obj_dbg (self, "setting default IP family to: IPv4");
input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv4,
input,
10,
g_task_get_cancellable (task),
(GAsyncReadyCallback)set_ip_family_ready,
task);
qmi_message_wds_set_ip_family_input_unref (input);
return;
}
ctx->step++;
/* fall through */
case CONNECT_STEP_ENABLE_INDICATIONS_IPV4: case CONNECT_STEP_ENABLE_INDICATIONS_IPV4:
common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self, common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self,
ctx->client_ipv4, ctx->client_ipv4,
@@ -1773,24 +1773,6 @@ connect_context_step (GTask *task)
ctx->step++; ctx->step++;
} /* fall through */ } /* fall through */
case CONNECT_STEP_IP_FAMILY_IPV6: {
QmiMessageWdsSetIpFamilyInput *input;
g_assert (ctx->no_ip_family_preference == FALSE);
mm_obj_dbg (self, "setting default IP family to: IPv6");
input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv6,
input,
10,
g_task_get_cancellable (task),
(GAsyncReadyCallback)set_ip_family_ready,
task);
qmi_message_wds_set_ip_family_input_unref (input);
return;
}
case CONNECT_STEP_BIND_DATA_PORT_IPV6: case CONNECT_STEP_BIND_DATA_PORT_IPV6:
/* If SIO port given, bind client to it */ /* If SIO port given, bind client to it */
if (ctx->sio_port != QMI_SIO_PORT_NONE) { if (ctx->sio_port != QMI_SIO_PORT_NONE) {
@@ -1833,6 +1815,24 @@ connect_context_step (GTask *task)
ctx->step++; ctx->step++;
/* fall through */ /* fall through */
case CONNECT_STEP_IP_FAMILY_IPV6: {
QmiMessageWdsSetIpFamilyInput *input;
g_assert (ctx->no_ip_family_preference == FALSE);
mm_obj_dbg (self, "setting default IP family to: IPv6");
input = qmi_message_wds_set_ip_family_input_new ();
qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL);
qmi_client_wds_set_ip_family (ctx->client_ipv6,
input,
10,
g_task_get_cancellable (task),
(GAsyncReadyCallback)set_ip_family_ready,
task);
qmi_message_wds_set_ip_family_input_unref (input);
return;
}
case CONNECT_STEP_ENABLE_INDICATIONS_IPV6: case CONNECT_STEP_ENABLE_INDICATIONS_IPV6:
common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self, common_setup_cleanup_packet_service_status_unsolicited_events (ctx->self,
ctx->client_ipv6, ctx->client_ipv6,