diff options
authorHarald Welte <laforge@gnumonks.org>2018-02-28 18:14:37 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-28 20:22:41 +0000
commit0be82004550a4296ca78c8d718b215d424989be2 (patch)
parentbae7af9c1362c49fa3b03b96dcfdd2fcebe43090 (diff)
pcu_sock: Log an error message and discard PCU primitives for BTS != 0
In OsmoBTS, we (so far?) only have a single BTS inside each process, let's make sure we log an error message if the PCU should ever want to transmit primitives to a non-zero BTS number. Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index c8308a9c..0d1f07af 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -621,6 +621,10 @@ static int pcu_rx(struct gsm_network *net, uint8_t msg_type,
struct gsm_bts *bts;
/* FIXME: allow multiple BTS */
+ if (pcu_prim->bts_nr != 0) {
+ LOGP(DPCU, LOGL_ERROR, "Received PCU Prim for non-existent BTS %u\n", pcu_prim->bts_nr);
+ return -EINVAL;
+ }
bts = llist_entry(net->bts_list.next, struct gsm_bts, list);
switch (msg_type) {