dexter has uploaded this change for review.

View Change

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
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/30873/1
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 1dcab56..c7a6560 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -226,6 +226,12 @@
trx = gsm_bts_trx_num(bts, i);
if (!trx)
continue;
+ if (trx->nr >= ARRAY_SIZE(info_ind->trx)) {
+ LOG_BTS(trx->bts, DPCU, LOGL_NOTICE, "PCU interface (version %u) "
+ "cannot handle more than %zu transceivers => skipped\n",
+ PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx));
+ continue;
+ }
info_ind->trx[i].hlayer1 = 0x2342;
info_ind->trx[i].pdch_mask = 0;
info_ind->trx[i].arfcn = trx->arfcn;

To view, visit change 30873. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42
Gerrit-Change-Number: 30873
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-MessageType: newchange