aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-07-02 22:52:04 +0200
committerHarald Welte <laforge@gnumonks.org>2010-07-02 22:52:04 +0200
commit23c13760cad0f97007078525f729187d5b8d6c24 (patch)
tree5f9494aaee1bde7d500f1b917e6b993e11d41a49 /openbsc
parentc5d4a0ced14b5c919e6ea01e8ce387da268428fd (diff)
[SGSN] SM: Properly parse APN and PCO Optional IE in PDP CTX ACT REQ
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_gmm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 48d162f82..4f54a5009 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -1103,16 +1103,22 @@ static int gsm48_rx_gsm_act_pdp_req(struct sgsn_mm_ctx *mmctx,
struct sgsn_ggsn_ctx *ggsn;
struct sgsn_pdp_ctx *pdp;
- memset(&tp, 0, sizeof(tp));
-
DEBUGP(DMM, "-> ACTIVATE PDP CONTEXT REQ: SAPI=%u NSAPI=%u ",
act_req->req_llc_sapi, act_req->req_nsapi);
+ /* FIXME: length checks! */
req_qos_len = act_req->data[0];
req_qos = act_req->data + 1; /* 10.5.6.5 */
req_pdpa_len = act_req->data[1 + req_qos_len];
req_pdpa = act_req->data + 1 + req_qos_len + 1; /* 10.5.6.4 */
+ /* Optional: Access Point Name, Protocol Config Options */
+ if (req_pdpa + req_pdpa_len < msg->data + msg->len)
+ tlv_parse(&tp, &gsm48_sm_att_tlvdef, req_pdpa + req_pdpa_len,
+ (msg->data + msg->len) - (req_pdpa + req_pdpa_len), 0, 0);
+ else
+ memset(&tp, 0, sizeof(tp));
+
switch (req_pdpa[0] & 0xf) {
case 0x0:
DEBUGPC(DMM, "ETSI ");