aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-07 11:51:16 +0100
committerHarald Welte <laforge@gnumonks.org>2013-02-08 08:25:17 +0100
commit75e13a41dc5ebd1dfd009814a60cf16df8681e74 (patch)
treeb863a039fdcfd95517ffe8c892f9afcef9463723
parent647db848e3eb9724dce31feeeee803d9b5b4dc68 (diff)
Fix of IMMIDIATE ASSIGNMENT REJECT message
The message was corrupt at several points. They are fixed now and successfully tested. A default T3122 timer value of 10 is defined by default now. If set to 0, the reject message will not be sent. Note that when using existing configs with T3122 value set to 0.
-rw-r--r--openbsc/include/openbsc/gsm_data.h1
-rw-r--r--openbsc/src/libbsc/abis_rsl.c7
-rw-r--r--openbsc/src/libcommon/gsm_data.c1
3 files changed, 7 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index feb692f7c..a4c6fbc68 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -192,6 +192,7 @@ enum gsm_auth_policy {
#define GSM_T3101_DEFAULT 10
#define GSM_T3105_DEFAULT 40
#define GSM_T3113_DEFAULT 60
+#define GSM_T3122_DEFAULT 10
struct gsm_network {
/* global parameters */
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 12f68e9b4..6b6265637 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1295,7 +1295,7 @@ static int rsl_send_imm_ass_rej(struct gsm_bts *bts,
/* create IMMEDIATE ASSIGN REJECT 04.08 message */
memset(iar, 0, sizeof(*iar));
iar->proto_discr = GSM48_PDISC_RR;
- iar->msg_type = GSM48_MT_RR_IMM_ASS;
+ iar->msg_type = GSM48_MT_RR_IMM_ASS_REJ;
iar->page_mode = GSM48_PM_SAME;
memcpy(&iar->req_ref1, &rqd_refs[0], sizeof(iar->req_ref1));
@@ -1319,7 +1319,10 @@ static int rsl_send_imm_ass_rej(struct gsm_bts *bts,
memcpy(&iar->req_ref4, &rqd_refs[0], sizeof(iar->req_ref4));
iar->wait_ind4 = wait_ind;
- return rsl_imm_assign_cmd(bts, sizeof(iar), (uint8_t *) iar);
+ /* we need to subtract 1 byte from sizeof(*iar) since ia includes the l2_plen field */
+ iar->l2_plen = GSM48_LEN2PLEN((sizeof(*iar)-1));
+
+ return rsl_imm_assign_cmd(bts, sizeof(*iar), (uint8_t *) iar);
}
/* MS has requested a channel on the RACH */
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index c9f41fcad..dd1d93bc2 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -97,6 +97,7 @@ struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_cod
net->T3101 = GSM_T3101_DEFAULT;
net->T3105 = GSM_T3105_DEFAULT;
net->T3113 = GSM_T3113_DEFAULT;
+ net->T3122 = GSM_T3122_DEFAULT;
/* FIXME: initialize all other timers! */
/* default set of handover parameters */