Check for suitable lchan type when detecting HO

Log error when handover RACH is detected on wrong channel: according to
3GPP TS 44.018 it can only be seen on SACCH and DCCH.

Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a
Related: OS#1898
This commit is contained in:
Max 2017-03-01 17:47:45 +01:00 committed by Harald Welte
parent 6f5e398ccb
commit 9dfdf54d30
2 changed files with 12 additions and 2 deletions

View File

@ -106,9 +106,17 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay)
return;
}
/* Ignore handover on channels other than DCCH and SACCH */
if (lchan->type != GSM_LCHAN_SDCCH && lchan->type != GSM_LCHAN_TCH_H &&
lchan->type != GSM_LCHAN_TCH_F) {
LOGP(DHO, LOGL_ERROR, "%s handover RACH received on %s?!\n",
gsm_lchan_name(lchan), gsm_lchant_name(lchan->type));
return;
}
LOGP(DHO, LOGL_NOTICE,
"%s RACH on dedicated channel received with TA=%u\n",
gsm_lchan_name(lchan), acc_delay);
"%s RACH on dedicated channel type %s received with TA=%u, ref=%u\n",
gsm_lchan_name(lchan), gsm_lchant_name(lchan->type), acc_delay, ra);
/* Set timing advance */
lchan->rqd_ta = acc_delay;

View File

@ -103,8 +103,10 @@ int main(int argc, char **argv)
/* create two lchans for handover */
lchan = &trx->ts[1].lchan[0];
lchan->type = GSM_LCHAN_SDCCH;
l1sap_chan_act(lchan->ts->trx, 0x09, NULL);
lchan = &trx->ts[2].lchan[0];
lchan->type = GSM_LCHAN_TCH_F;
lchan->ho.active = HANDOVER_ENABLED;
lchan->ho.ref = 23;
l1sap_chan_act(lchan->ts->trx, 0x0a, NULL);