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
This commit is contained in:
Holger Hans Peter Freyther 2013-01-16 21:07:43 +01:00
parent 69665f8722
commit 164ee307b2
1 changed files with 13 additions and 3 deletions

View File

@ -1525,16 +1525,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, SACCH_DEACTIVATE);
}