From f7198d7dbb84d038a82eec5ad0b86f7f29ca411e Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Tue, 22 May 2018 18:29:14 +0200 Subject: gprs_gmm: introduce a GMM Attach Request FSM The old GMM Attach Request handling used a recursive function which can not handle certain states and is quite complex and hard to extend. The new FSM handles such request in a FSM and can be called multiple times. Change-Id: I58b9c17be9776a03bb2a5b21e99135cfefc8c912 --- src/gprs/gprs_sgsn.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gprs/gprs_sgsn.c') diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index d8bca8577..977ae4898 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -241,6 +242,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli, talloc_free(ctx); return NULL; } + ctx->gmm_att_req.fsm = osmo_fsm_inst_alloc(&gmm_attach_req_fsm, ctx, ctx, LOGL_DEBUG, "gb_gmm_req"); INIT_LLIST_HEAD(&ctx->pdp_list); llist_add(&ctx->list, &sgsn_mm_ctxts); @@ -273,6 +275,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx) talloc_free(ctx); return NULL; } + ctx->gmm_att_req.fsm = osmo_fsm_inst_alloc(&gmm_attach_req_fsm, ctx, ctx, LOGL_DEBUG, "gb_gmm_req"); /* Need to get RAID from IU conn */ ctx->ra = ctx->iu.ue_ctx->ra_id; @@ -350,6 +353,9 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm) gprs_subscr_put(subscr); } + if (mm->gmm_att_req.fsm) + gmm_att_req_free(mm); + sgsn_mm_ctx_free(mm); mm = NULL; -- cgit v1.2.3