aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-03-01 17:47:45 +0100
committerHarald Welte <laforge@gnumonks.org>2017-03-14 14:17:44 +0000
commit9dfdf54d30079146627105c7f764e16d486559ba (patch)
tree5ee9e97533fd7243539dec2de2c5b044218d3fae
parent6f5e398ccb10c0095061d9adf39f0ebcebd0c876 (diff)
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
-rw-r--r--src/common/handover.c12
-rw-r--r--tests/handover/handover_test.c2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/common/handover.c b/src/common/handover.c
index 03433ea5..45ed0406 100644
--- a/src/common/handover.c
+++ b/src/common/handover.c
@@ -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;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index a7a66d06..611c441b 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -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);