[MERGED] osmo-bts[master]: pcu_sock: Log an error message and discard PCU primitives fo...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Feb 28 21:05:25 UTC 2018


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 <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling <ssperling at sysmocom.de>



More information about the gerrit-log mailing list