aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-01-16 21:07:43 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-06-12 09:40:16 +0200
commit435e0debc393ffb6bf0ad7498552d796c9e3d32e (patch)
tree8327211e4514ca7bd8650cb127e732dde511dc8f
parent3ea105614e38df7f3c5e585cb95eef461e132ef1 (diff)
rsl: Properly parse the RLM cause from the error indication
The code predates the TLV parser and we were parsing the RLM from the wrong offset. In general we were using the length of the TLV which happened to be equal to the T200 indication. After consulting the RLM cuases not every of them should generate a BSC_RLLR_IND_ERR_IND as these are forwarded to the MSC as a SAPI reject right now. TLV parsing now generates this due a bug in the osmo-bts code: abis_rsl.c:1605 (bts=0,trx=0,ts=2,ss=0) SAPI=0 <0000> abis_rsl.c:1547 (bts=0,trx=0,ts=2,ss=0) ERROR INDICATION cause=Fraeme not implemented
-rw-r--r--openbsc/src/libbsc/abis_rsl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index e9d35953f..7069aaaf3 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1365,16 +1365,26 @@ static int abis_rsl_rx_cchan(struct msgb *msg)
static int rsl_rx_rll_err_ind(struct msgb *msg)
{
+ struct tlv_parsed tp;
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
- uint8_t *rlm_cause = rllh->data;
+ uint8_t rlm_cause;
+
+ rsl_tlv_parse(&tp, rllh->data, msgb_l2len(msg) - sizeof(*rllh));
+ if (!TLVP_PRESENT(&tp, RSL_IE_RLM_CAUSE)) {
+ LOGP(DRLL, LOGL_ERROR,
+ "%s ERROR INDICATION without mandantory cause.\n",
+ gsm_lchan_name(msg->lchan));
+ return -1;
+ }
+ rlm_cause = *TLVP_VAL(&tp, RSL_IE_RLM_CAUSE);
LOGP(DRLL, LOGL_ERROR, "%s ERROR INDICATION cause=%s\n",
gsm_lchan_name(msg->lchan),
- rsl_rlm_cause_name(rlm_cause[1]));
+ rsl_rlm_cause_name(rlm_cause));
rll_indication(msg->lchan, rllh->link_id, BSC_RLLR_IND_ERR_IND);
- if (rlm_cause[1] == RLL_CAUSE_T200_EXPIRED) {
+ if (rlm_cause == RLL_CAUSE_T200_EXPIRED) {
osmo_counter_inc(msg->lchan->ts->trx->bts->network->stats.chan.rll_err);
return rsl_rf_chan_release(msg->lchan, 1);
}