diff --git a/include/osmocom/sgsn/gprs_gb.h b/include/osmocom/sgsn/gprs_gb.h index c98dd3448..916236761 100644 --- a/include/osmocom/sgsn/gprs_gb.h +++ b/include/osmocom/sgsn/gprs_gb.h @@ -8,7 +8,7 @@ int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, bool drop_cipherable); /* Has to be called whenever any PDU (signaling, data, ...) has been received */ -void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx); +void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg); /* page a MS in its routing area */ int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx); diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c index 2585d6dc2..cddd1b1e1 100644 --- a/src/sgsn/gprs_gb.c +++ b/src/sgsn/gprs_gb.c @@ -38,7 +38,8 @@ #include /* Has to be called whenever any PDU (signaling, data, ...) has been received */ -void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx) { +void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg) { + msgid2mmctx(mmctx, msg); if (mmctx->gb.llme) osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_PDU_RECEPTION, NULL); } @@ -56,10 +57,9 @@ int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &ra_id); if (mmctx) { - msgid2mmctx(mmctx, msg); rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]); mmctx->gb.llme = llme; - gprs_gb_recv_pdu(mmctx); + gprs_gb_recv_pdu(mmctx, msg); } /* MMCTX can be NULL */ diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c index b237bf9ad..6692f1ae5 100644 --- a/src/sgsn/gprs_sndcp.c +++ b/src/sgsn/gprs_sndcp.c @@ -808,7 +808,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle, lle, lle->llme->tlli, lle->sapi, sch->nsapi); return -EIO; } - gprs_gb_recv_pdu(mmctx); + gprs_gb_recv_pdu(mmctx, msg); if (scomph) { sne->defrag.pcomp = scomph->pcomp;