aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_libgtp.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-01 19:56:19 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-01 19:56:19 +0200
commit8911cef81db03c6d3b3f6b7361a56538f8b2dd5c (patch)
tree567406255b89d3b18f0f62f77f58e629e84c5220 /openbsc/src/gprs/sgsn_libgtp.c
parent951a12cf4e6ab74d96466de5462265070b345291 (diff)
[SGSN] Fix segfault when passing re-assembled SN-PDU to GMM
sgsn_rx_sndcp_ud_ind() can no longer make the assumption that msgb_bcid() is valid, as this is only true for an un-fragmented SN-PDU. So instead, we now store the RAID in the SNDCP Entity and pass it as an explicit argument to sgsn_rx_sndcp_ud_ind().
Diffstat (limited to 'openbsc/src/gprs/sgsn_libgtp.c')
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index ed15bbec4..09bdcc49a 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -419,16 +419,14 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
}
/* Called by SNDCP when it has received/re-assembled a N-PDU */
-int sgsn_rx_sndcp_ud_ind(uint32_t tlli, uint8_t nsapi, struct msgb *msg,
- uint32_t npdu_len, uint8_t *npdu)
+int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
+ struct msgb *msg, uint32_t npdu_len, uint8_t *npdu)
{
struct sgsn_mm_ctx *mmctx;
struct sgsn_pdp_ctx *pdp;
- struct gprs_ra_id ra_id;
/* look-up the MM context for this message */
- bssgp_parse_cell_id(&ra_id, msgb_bcid(msg));
- mmctx = sgsn_mm_ctx_by_tlli(tlli, &ra_id);
+ mmctx = sgsn_mm_ctx_by_tlli(tlli, ra_id);
if (!mmctx) {
LOGP(DGPRS, LOGL_ERROR,
"Cannot find MM CTX for TLLI %08x\n", tlli);