aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-01 19:08:21 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 17:40:55 +0200
commita4feac25d0bee6a10beb053c5e0569cabb352585 (patch)
tree074f8ad78aeb531d57a4abcebba7ac30a1f2ef9e
parentecee67d9e88030d1bd01142842d6c38919b8f094 (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--src/gprs/sgsn_libgtp.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index bc2fcd1e..7ff8ece5 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -251,18 +251,28 @@ 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));
- /* Routing Area Identifier with LAC and RAC fixed values, as
- * requested in 29.006 7.3.1 */
+ /* Encode RAT Type according to TS 29.060 7.7.50 */
+ pdp->rattype.l = 1;
+ 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 */
pdp->rai_given = 1;
pdp->rai.l = 6;
+
+ /* Routing Area Identifier with LAC and RAC fixed values, as
+ * requested in 29.006 7.3.1 */
raid = mmctx->ra;
raid.lac = 0xFFFE;
raid.rac = 0xFF;
gsm48_construct_ra(pdp->rai.v, &raid);
- pdp->rattype.l = 1;
- pdp->rattype_given = 1;
-
+ /* Encode User Location Information accordint to TS 29.060 7.7.51 */
+ pdp->userloc_given = 1;
+ pdp->userloc.l = 8;
switch (mmctx->ran_type) {
case MM_CTX_T_GERAN_Gb:
case MM_CTX_T_GERAN_Iu:
@@ -274,8 +284,9 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id);
break;
case MM_CTX_T_UTRAN_Iu:
- pdp->rattype.v[0] = 1;
- /* FIXME: Optional User Location Information with SAI */
+ 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);
break;
}