aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gb_proxy.c4
-rw-r--r--openbsc/src/gprs/gprs_gb_parse.c13
-rw-r--r--openbsc/src/gprs/gprs_gmm.c2
3 files changed, 13 insertions, 6 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 955133562..6e6b03b86 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -462,8 +462,8 @@ static int gbproxy_imsi_acquisition(struct gbproxy_peer *peer,
if (link_info->imsi_acq_pending && link_info->imsi_len > 0) {
int is_ident_resp =
parse_ctx->g48_hdr &&
- parse_ctx->g48_hdr->proto_discr == GSM48_PDISC_MM_GPRS &&
- parse_ctx->g48_hdr->msg_type == GSM48_MT_GMM_ID_RESP;
+ gsm48_hdr_pdisc(parse_ctx->g48_hdr) == GSM48_PDISC_MM_GPRS &&
+ gsm48_hdr_msg_type(parse_ctx->g48_hdr) == GSM48_MT_GMM_ID_RESP;
/* The IMSI is now available */
gbproxy_flush_stored_messages(peer, msg, now, link_info,
diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/openbsc/src/gprs/gprs_gb_parse.c
index 609685407..63ac9028d 100644
--- a/openbsc/src/gprs/gprs_gb_parse.c
+++ b/openbsc/src/gprs/gprs_gb_parse.c
@@ -329,17 +329,20 @@ int gprs_gb_parse_dtap(uint8_t *data, size_t data_len,
struct gprs_gb_parse_context *parse_ctx)
{
struct gsm48_hdr *g48h;
+ uint8_t pdisc;
+ uint8_t msg_type;
if (gprs_shift_v_fixed(&data, &data_len, sizeof(*g48h), (uint8_t **)&g48h) <= 0)
return 0;
parse_ctx->g48_hdr = g48h;
- if ((g48h->proto_discr & 0x0f) != GSM48_PDISC_MM_GPRS &&
- (g48h->proto_discr & 0x0f) != GSM48_PDISC_SM_GPRS)
+ pdisc = gsm48_hdr_pdisc(g48h);
+ if (pdisc != GSM48_PDISC_MM_GPRS && pdisc != GSM48_PDISC_SM_GPRS)
return 1;
- switch (g48h->msg_type) {
+ msg_type = gsm48_hdr_msg_type(g48h);
+ switch (msg_type) {
case GSM48_MT_GMM_ATTACH_REQ:
return gprs_gb_parse_gmm_attach_req(data, data_len, parse_ctx);
@@ -376,6 +379,10 @@ int gprs_gb_parse_dtap(uint8_t *data, size_t data_len,
break;
default:
+ LOGP(DLLC, LOGL_NOTICE,
+ "Unknown GSM 04.08 message type 0x%02hhx for protocol"
+ " discriminator 0x%02hhx.\n",
+ msg_type, pdisc);
break;
};
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index d93ba3f77..9d94c24fe 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -2089,7 +2089,7 @@ int gsm0408_gprs_force_reattach(struct sgsn_mm_ctx *mmctx)
int gsm0408_gprs_rcvmsg(struct msgb *msg, struct gprs_llc_llme *llme)
{
struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
- uint8_t pdisc = gh->proto_discr & 0x0f;
+ uint8_t pdisc = gsm48_hdr_pdisc(gh);
struct sgsn_mm_ctx *mmctx;
struct gprs_ra_id ra_id;
int rc = -EINVAL;