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

2018-02-28 Thread Harald Welte

Review at  https://gerrit.osmocom.org/6997

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/6997/1

diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index c8308a9..0818388 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-existant 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: newchange
Gerrit-Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


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

2018-02-28 Thread Harald Welte
Hello Stefan Sperling, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/6997

to look at the new patch set (#3).

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(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/6997/3

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: newpatchset
Gerrit-Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling