aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-01 03:32:50 +0100
committerHarald Welte <laforge@gnumonks.org>2016-11-03 14:12:31 +0100
commitcd3bfbaa0e1e0e1285a460b8335f78c801490bf2 (patch)
tree90a7e7ac6c0f1c73d475924c4a937ea3b779a234
parentb748012d3186209c0f4c38ebb7113ce7c60e333b (diff)
SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP
The GTP protocol specification requires us to include the MSISDN IE in all non-secondary PDP context activations. However, when no real HLR is used (e.g. via GSUP), we do not have the MSISDN information available and so far simply sent a zero-length MSISDN IE in GTP. The latter is a violation of the spec. So to resolve this, we now send a 15-digit all-zero dummy MSISDN IE, as described in TS 23.003. Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index 29c9f066a..072b9baf0 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -59,6 +59,15 @@
#include <gtp.h>
#include <pdp.h>
+/* TS 23.003: The MSISDN shall take the dummy MSISDN value composed of
+ * 15 digits set to 0 (encoded as an E.164 international number) when
+ * the MSISDN is not available in messages in which the presence of the
+ * MSISDN parameter */
+static const uint8_t dummy_msisdn[] =
+ { 0x91, /* No extension, international, E.164 */
+ 0, 0, 0, 0, 0, 0, 0, /* 14 digits of zeroes */
+ 0xF0 /* 15th digit of zero + padding */ };
+
const struct value_string gtp_cause_strs[] = {
{ GTPCAUSE_REQ_IMSI, "Request IMSI" },
{ GTPCAUSE_REQ_IMEI, "Request IMEI" },
@@ -167,12 +176,16 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
/* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */
/* Put the MSISDN in case we have it */
- if (mmctx->subscr) {
+ if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) {
pdp->msisdn.l = mmctx->subscr->sgsn_data->msisdn_len;
if (pdp->msisdn.l > sizeof(pdp->msisdn.v))
pdp->msisdn.l = sizeof(pdp->msisdn.v);
memcpy(pdp->msisdn.v, mmctx->subscr->sgsn_data->msisdn,
pdp->msisdn.l);
+ } else {
+ /* use the dummy 15-digits-zero MSISDN value */
+ pdp->msisdn.l = sizeof(dummy_msisdn);
+ memcpy(pdp->msisdn.v, dummy_msisdn, pdp->msisdn.l);
}
/* End User Address from GMM requested PDP address */