ranap_iu_tx_release_free(): always trigger RANAP_IU_EVENT_IU_RELEASE as a result

This allows the SGSN always having feedback on the resolution of the
release, hence being able to stay in PMM CONNECTED state until the
resolution is received, then moving to PMM IDLE.

Related: SYS#5389
Change-Id: Iac822c74e56750dc40e94573eae0e20853ff68c0
This commit is contained in:
Pau Espin 2021-04-13 19:56:10 +02:00
parent 68a796ebc5
commit 7fcd33df8c
2 changed files with 13 additions and 8 deletions

View File

@ -75,9 +75,9 @@ int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_v
int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *ue_ctx, const char *imsi);
int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause);
/* transmit a Iu Release Command and free the ctx afterwards.
* If a Release Complete is not received within timeout s,
* release the SCCP connection. */
/* Transmit a Iu Release Command and submit event RANAP_IU_EVENT_IU_RELEASE upon
* Release Complete or timeout. Caller is responsible to free the context and
* closing the SCCP connection (ranap_iu_free_ue) upon recieval of the event. */
void ranap_iu_tx_release_free(struct ranap_ue_conn_ctx *ctx,
const struct RANAP_Cause *cause,
int timeout);

View File

@ -124,6 +124,12 @@ static int global_iu_event(struct ranap_ue_conn_ctx *ue_ctx,
return global_iu_event_cb(ue_ctx, type, data);
}
static void ue_conn_ctx_release_timeout_cb(void *ctx_)
{
struct ranap_ue_conn_ctx *ctx = (struct ranap_ue_conn_ctx *)ctx_;
global_iu_event(ctx, RANAP_IU_EVENT_IU_RELEASE, NULL);
}
static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uint32_t conn_id)
{
struct ranap_ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ranap_ue_conn_ctx);
@ -133,7 +139,7 @@ static struct ranap_ue_conn_ctx *ue_conn_ctx_alloc(struct ranap_iu_rnc *rnc, uin
ctx->notification = true;
ctx->free_on_release = false;
osmo_timer_setup(&ctx->release_timeout,
(void *)(void *) ranap_iu_free_ue,
ue_conn_ctx_release_timeout_cb,
ctx);
llist_add(&ctx->list, &ue_conn_ctx_list);
@ -501,10 +507,9 @@ void ranap_iu_tx_release_free(struct ranap_ue_conn_ctx *ctx,
ctx->notification = false;
ctx->free_on_release = true;
int ret = ranap_iu_tx_release(ctx, cause);
if (ret) {
ranap_iu_free_ue(ctx);
return;
}
/* On Tx failure, trigger timeout immediately, as the response will never arrive */
if (ret)
timeout = 0;
osmo_timer_schedule(&ctx->release_timeout, timeout, 0);
}