diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-15 22:09:39 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-15 20:24:19 +0800 |
commit | 87ef2f27e4c0dc1e3467293a80d306707cc0445b (patch) | |
tree | b288114c7b512577fb04d2ac0e938013ac7cec46 | |
parent | bcb32a4ad9d2efc4ae4904780a6347385ff0ba39 (diff) |
[nat] Check proto descriptor and the message type
-rw-r--r-- | openbsc/src/nat/bsc_nat_utils.c | 6 |
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 e96735549..49095007d 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; |