From a8f782502b48f685464a287c01306af225fa7ec5 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 16 Sep 2019 02:44:58 +0200 Subject: sgsn: when receiving data PDU notify the Gb GMM fsm When receiving a PDU, the GMM fsm will change to state MM_READY and will re-arm the T3314 Relates: OS#1941 Change-Id: I78f40762fb17bbd4a6f35608a793f8e5271e9b86 --- src/sgsn/gprs_gb.c | 8 +++++++- src/sgsn/gprs_sndcp.c | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/sgsn') diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c index 2d9c25a14..9fa8e00b4 100644 --- a/src/sgsn/gprs_gb.c +++ b/src/sgsn/gprs_gb.c @@ -34,6 +34,12 @@ #include #include +/* Has to be called whenever any PDU (signaling, data, ...) has been received */ +void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx) { + if (mmctx->gb.llme) + osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_PDU_RECEPTION, NULL); +} + /* Main entry point for incoming 04.08 GPRS messages from Gb */ int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, bool drop_cipherable) @@ -50,7 +56,7 @@ int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, msgid2mmctx(mmctx, msg); rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]); mmctx->gb.llme = llme; - osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_PDU_RECEPTION, NULL); + gprs_gb_recv_pdu(mmctx); } /* MMCTX can be NULL */ diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c index d9aa1e576..01be57ef2 100644 --- a/src/sgsn/gprs_sndcp.c +++ b/src/sgsn/gprs_sndcp.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -745,6 +746,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle, struct sndcp_common_hdr *sch = (struct sndcp_common_hdr *)hdr; struct sndcp_comp_hdr *scomph = NULL; struct sndcp_udata_hdr *suh; + struct sgsn_mm_ctx *mmctx; uint8_t *npdu; uint16_t npdu_num __attribute__((unused)); int npdu_len; @@ -778,6 +780,15 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle, /* FIXME: move this RA_ID up to the LLME or even higher */ bssgp_parse_cell_id(&sne->ra_id, msgb_bcid(msg)); + mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &sne->ra_id); + if (!mmctx) { + LOGP(DSNDCP, LOGL_ERROR, "Message for non-existing MM ctx " + "(lle=%p, TLLI=%08x, SAPI=%u, NSAPI=%u)\n", + lle, lle->llme->tlli, lle->sapi, sch->nsapi); + return -EIO; + } + gprs_gb_recv_pdu(mmctx); + if (scomph) { sne->defrag.pcomp = scomph->pcomp; sne->defrag.dcomp = scomph->dcomp; -- cgit v1.2.3