summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-01 19:08:21 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-14 12:31:54 +0200
commit91dd2a62bee77b56a953e0edc55c5441aa3b5d84 (patch)
treeba39ee46ab14090991f55ea4a3f2dd6b2a4e8ac3
parent06bd94b8f5601fddb4842e9a6a685b21f6a6d7e2 (diff)
SGSN: Fix RAN information exposed on GTP during PDP CTX CREATE
In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index 387b95f6b..e90b66dcf 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -251,9 +251,12 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
memcpy(pdp->gsnlu.v, &sgsn->cfg.gtp_listenaddr.sin_addr,
sizeof(sgsn->cfg.gtp_listenaddr.sin_addr));
- /* Assume we are a GERAN system */
+ /* Encode RAT Type according to TS 29.060 7.7.50 */
pdp->rattype.l = 1;
- pdp->rattype.v[0] = 2;
+ if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu)
+ pdp->rattype.v[0] = 1;
+ else
+ pdp->rattype.v[0] = 2;
pdp->rattype_given = 1;
/* Include RAI and ULI all the time */
@@ -264,10 +267,17 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
raid.rac = 0xFF;
gsm48_construct_ra(pdp->rai.v, &raid);
+ /* Encode User Location Information accordint to TS 29.060 7.7.51 */
pdp->userloc_given = 1;
pdp->userloc.l = 8;
- pdp->userloc.v[0] = 0; /* CGI for GERAN */
- bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id);
+ if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) {
+ pdp->userloc.v[0] = 1; /* SAI for UTRAN */
+ /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */
+ bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac);
+ } else {
+ pdp->userloc.v[0] = 0; /* CGI for GERAN */
+ bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id);
+ }
/* include the IMEI(SV) */
pdp->imeisv_given = 1;