aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/pcu_sock.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-01-05 13:04:21 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2023-01-12 15:39:30 +0100
commita8ad2b1b9316e28722593c1025876a1aabaea47e (patch)
tree1188a521cab35e6fedc85a5fca22a511c8fd8ea9 /src/osmo-bsc/pcu_sock.c
parent0b7d9b26b6794d0392b798018f5ab7ee7e4f73b0 (diff)
pcu_sock: guard against too many TRX
The pcuif only supports a limited but sufficient number of TRXs. When filling in the TRX array in info_ind, we must guard against overflowing the maximum number of TRXs Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42 Related: OS#5198
Diffstat (limited to 'src/osmo-bsc/pcu_sock.c')
-rw-r--r--src/osmo-bsc/pcu_sock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 1dcab566f..ab3b7d5d2 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -226,6 +226,12 @@ static int pcu_tx_info_ind(struct gsm_bts *bts)
trx = gsm_bts_trx_num(bts, i);
if (!trx)
continue;
+ if (trx->nr >= ARRAY_SIZE(info_ind->trx)) {
+ LOG_TRX(trx, DPCU, LOGL_NOTICE, "PCU interface (version %u) "
+ "cannot handle more than %zu transceivers => skipped\n",
+ PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx));
+ break;
+ }
info_ind->trx[i].hlayer1 = 0x2342;
info_ind->trx[i].pdch_mask = 0;
info_ind->trx[i].arfcn = trx->arfcn;