huawei: handle pending network-initiated disconnection in disconnect_3gpp
If a client-initiated disconnection attempt is issued while a network-initiated disconnection is still pending, the latter may interfere with the former. Also, when the client-initiated disconnection attempt fails but the bearer status is reported as 'disconnected', the pending network-initiated disconnection is not cleared and may result in an assertion when a connection attempt is issued. This patch addresses the issue by clearing any pending network-initiated disconnection before proceeding with a client-initiated disconnection.
This commit is contained in:

committed by
Aleksander Morgado

parent
613155cb2e
commit
686caef536
@@ -551,6 +551,14 @@ disconnect_3gpp_context_step (Disconnect3gppContext *ctx)
|
|||||||
/* Store the context */
|
/* Store the context */
|
||||||
ctx->self->priv->disconnect_pending = ctx;
|
ctx->self->priv->disconnect_pending = ctx;
|
||||||
|
|
||||||
|
/* We ignore any pending network-initiated disconnection in order to prevent it
|
||||||
|
* from interfering with the client-initiated disconnection, as we would like to
|
||||||
|
* proceed with the latter anyway. */
|
||||||
|
if (ctx->self->priv->network_disconnect_pending_id != 0) {
|
||||||
|
g_source_remove (ctx->self->priv->network_disconnect_pending_id);
|
||||||
|
ctx->self->priv->network_disconnect_pending_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->step++;
|
ctx->step++;
|
||||||
/* Fall down to the next step */
|
/* Fall down to the next step */
|
||||||
|
|
||||||
@@ -605,11 +613,6 @@ disconnect_3gpp_context_step (Disconnect3gppContext *ctx)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case DISCONNECT_3GPP_CONTEXT_STEP_LAST:
|
case DISCONNECT_3GPP_CONTEXT_STEP_LAST:
|
||||||
if (ctx->self->priv->network_disconnect_pending_id != 0) {
|
|
||||||
g_source_remove (ctx->self->priv->network_disconnect_pending_id);
|
|
||||||
ctx->self->priv->network_disconnect_pending_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear context */
|
/* Clear context */
|
||||||
ctx->self->priv->disconnect_pending = NULL;
|
ctx->self->priv->disconnect_pending = NULL;
|
||||||
/* Set data port as result */
|
/* Set data port as result */
|
||||||
|
Reference in New Issue
Block a user