Harald Welte has submitted this change and it was merged.

Change subject: pcu_sock: Log an error message and discard PCU primitives for 
BTS != 0
......................................................................


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

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index c8308a9..0d1f07a 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -621,6 +621,10 @@
        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) {

-- 
To view, visit https://gerrit.osmocom.org/6997
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling <[email protected]>

Reply via email to