From 6888021bf2ba6ef9bef30d27bea52c8d7fd2de34 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 10 Sep 2019 16:32:05 +0200 Subject: mm_gb_fsm: unassign the llme when entering MM_IDLE MM_IDLE means there is no known state to this MM. Change-Id: Ieb0d6cea828842763c13942fe1a63dd89399f799 --- src/sgsn/gprs_mm_state_gb_fsm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sgsn/gprs_mm_state_gb_fsm.c b/src/sgsn/gprs_mm_state_gb_fsm.c index 2056540db..4e1ed48d5 100644 --- a/src/sgsn/gprs_mm_state_gb_fsm.c +++ b/src/sgsn/gprs_mm_state_gb_fsm.c @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -16,6 +17,15 @@ static const struct osmo_tdef_state_timeout mm_state_gb_fsm_timeouts[32] = { #define mm_state_gb_fsm_state_chg(fi, NEXT_STATE) \ osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, mm_state_gb_fsm_timeouts, sgsn->cfg.T_defs, -1) +static void st_mm_idle_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state) { + struct sgsn_mm_ctx *ctx = fi->priv; + + if (ctx->gb.llme) { + gprs_llgmm_unassign(ctx->gb.llme); + ctx->gb.llme = NULL; + } +} + static void st_mm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch(event) { @@ -59,6 +69,7 @@ static struct osmo_fsm_state mm_state_gb_fsm_states[] = { [ST_MM_IDLE] = { .in_event_mask = X(E_MM_GPRS_ATTACH) | X(E_MM_PDU_RECEPTION), .out_state_mask = X(ST_MM_READY), + .onenter = st_mm_idle_on_enter, .name = "Idle", .action = st_mm_idle, }, -- cgit v1.2.3