aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-15 22:09:39 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-15 23:55:28 +0800
commit57900f00088e99731ad0d22cb1701eaa22cc25f0 (patch)
treeb3120019d88429f73f666b4c97045f691959202b
parent66ac860f6213a18ee18e135e2367d09f59539339 (diff)
[nat] Check proto descriptor and the message type
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 2e0c5a45a..d5cad896f 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -345,9 +345,11 @@ int bsc_nat_filter_sccp_cr(struct bsc_connection *bsc, struct msgb *msg, struct
hdr48 = (struct gsm48_hdr *) TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION);
- if (hdr48->msg_type == GSM48_MT_MM_LOC_UPD_REQUEST) {
+ if (hdr48->proto_discr == GSM48_PDISC_MM &&
+ hdr48->msg_type == GSM48_MT_MM_LOC_UPD_REQUEST) {
return _cr_check_loc_upd(bsc, &hdr48->data[0], hdr48_len - sizeof(*hdr48));
- } else if (hdr48->msg_type == GSM48_MT_MM_CM_SERV_REQ) {
+ } else if (hdr48->proto_discr == GSM48_PDISC_MM &&
+ hdr48->msg_type == GSM48_MT_MM_CM_SERV_REQ) {
return _cr_check_cm_serv_req(bsc, &hdr48->data[0], hdr48_len - sizeof(*hdr48));
} else {
return 0;