aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 03:52:13 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 08:15:11 +0800
commit75042b80be042be97043587463cb0f4cdce93256 (patch)
tree7919f51d5952b67e15b1a0e09feb8ce92cc3512c /openbsc
parentc32589f39526a898a441e85a7cbe913cdc557774 (diff)
[nat] Send a GSM48 message within the reject message
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/nat/bsc_nat.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 24233a2f..e2f15e79 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -45,6 +45,7 @@
#include <openbsc/telnet_interface.h>
#include <osmocore/talloc.h>
+#include <osmocore/gsm0808.h>
#include <vty/vty.h>
@@ -297,8 +298,25 @@ static void bsc_send_data(struct bsc_connection *bsc, const u_int8_t *data, unsi
static void bsc_send_con_refuse(struct bsc_connection *bsc,
struct bsc_nat_parsed *parsed, int con_type)
{
+ struct msgb *payload;
struct msgb *refuse;
- refuse = sccp_create_refuse(parsed->src_local_ref, SCCP_REFUSAL_SCCP_FAILURE, NULL, 0);
+
+ if (con_type == NAT_CON_TYPE_LU) {
+ payload = gsm48_create_loc_upd_rej(GSM48_REJECT_PLMN_NOT_ALLOWED);
+ gsm0808_prepend_dtap_header(payload, 0);
+ } else if (con_type == NAT_CON_TYPE_CM_SERV_REQ) {
+ payload = gsm48_create_mm_serv_rej(GSM48_REJECT_PLMN_NOT_ALLOWED);
+ gsm0808_prepend_dtap_header(payload, 0);
+ }
+
+ refuse = sccp_create_refuse(parsed->src_local_ref,
+ SCCP_REFUSAL_SCCP_FAILURE,
+ payload ? payload->data : NULL,
+ payload ? payload->len : 0);
+
+ if (payload)
+ msgb_free(payload);
+
if (!refuse) {
LOGP(DNAT, LOGL_ERROR,
"Creating refuse msg failed for SCCP 0x%x on BSC Nr: %d.\n",