Change in osmo-trx[master]: sigProcLib: introduce both TS1 and TS2 RACH synch. sequences

2018-10-21 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11390 )

Change subject: sigProcLib: introduce both TS1 and TS2 RACH synch. sequences
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11390
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Assignee: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Comment-Date: Mon, 22 Oct 2018 01:08:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: VTY: add extended (11-bit) RACH detection toggle

2018-10-21 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11423


Change subject: VTY: add extended (11-bit) RACH detection toggle
..

VTY: add extended (11-bit) RACH detection toggle

Since I838c21db29c54f1924dd478c2b34b46b70aab2cd we have both TS1
and TS2 synch. sequences, in addition to "default" TS0. Let's
finally introduce the VTY configuration parameter, that can
be used to toggle optional detection of both TS1 and TS2.

Note: we keep this optional because of potentially bad impact on
performance. There's no point in paying the performance penalty
unless upper levels (BTS, PCU) actually make use of it.

Change-Id: I1aee998d83b06692d76a83f79748f9129a2547e8
Related: OS#3054
---
M CommonLibs/trx_vty.c
M CommonLibs/trx_vty.h
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/osmo-trx.cpp
M doc/examples/osmo-trx-lms/osmo-trx-limesdr.cfg
M doc/examples/osmo-trx-uhd/osmo-trx-limesdr.cfg
M doc/examples/osmo-trx-uhd/osmo-trx-umtrx.cfg
M doc/examples/osmo-trx-uhd/osmo-trx-usrp_b200.cfg
9 files changed, 40 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/23/11423/1

diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index 45b58eb..1bece1e 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -304,6 +304,22 @@
return CMD_SUCCESS;
 }

+DEFUN(cfg_ext_rach, cfg_ext_rach_cmd,
+   "ext-rach (disable|enable)",
+   "Enable extended (11-bit) RACH (default=disable)\n")
+{
+   struct trx_ctx *trx = trx_from_vty(vty);
+
+   if (strcmp("disable", argv[0]) == 0)
+   trx->cfg.ext_rach = false;
+   else if (strcmp("enable", argv[0]) == 0)
+   trx->cfg.ext_rach = true;
+   else
+   return CMD_WARNING;
+
+   return CMD_SUCCESS;
+}
+
 DEFUN(cfg_rt_prio, cfg_rt_prio_cmd,
"rt-prio <1-32>",
"Set the SCHED_RR real-time priority\n"
@@ -417,6 +433,7 @@
vty_out(vty, " rssi-offset %f%s", trx->cfg.rssi_offset, 
VTY_NEWLINE);
vty_out(vty, " swap-channels %s%s", trx->cfg.swap_channels ? "enable" : 
"disable", VTY_NEWLINE);
vty_out(vty, " egprs %s%s", trx->cfg.egprs ? "enable" : "disable", 
VTY_NEWLINE);
+   vty_out(vty, " ext-rach %s%s", trx->cfg.ext_rach ? "enable" : 
"disable", VTY_NEWLINE);
if (trx->cfg.sched_rr != 0)
vty_out(vty, " rt-prio %u%s", trx->cfg.sched_rr, VTY_NEWLINE);

@@ -454,6 +471,7 @@
vty_out(vty, " RSSI to dBm offset: %f%s", trx->cfg.rssi_offset, 
VTY_NEWLINE);
vty_out(vty, " Swap channels: %s%s", trx->cfg.swap_channels ? "Enabled" 
: "Disabled", VTY_NEWLINE);
vty_out(vty, " EDGE support: %s%s", trx->cfg.egprs ? "Enabled" : 
"Disabled", VTY_NEWLINE);
+   vty_out(vty, " Extended RACH support: %s%s", trx->cfg.ext_rach ? 
"Enabled" : "Disabled", VTY_NEWLINE);
vty_out(vty, " Real Time Priority: %u (%s)%s", trx->cfg.sched_rr,
trx->cfg.sched_rr ? "Enabled" : "Disabled", VTY_NEWLINE);
vty_out(vty, " Channels: %u%s", trx->cfg.num_chans, VTY_NEWLINE);
@@ -564,6 +582,7 @@
install_element(TRX_NODE, _rssi_offset_cmd);
install_element(TRX_NODE, _swap_channels_cmd);
install_element(TRX_NODE, _egprs_cmd);
+   install_element(TRX_NODE, _ext_rach_cmd);
install_element(TRX_NODE, _rt_prio_cmd);
install_element(TRX_NODE, _filler_cmd);

diff --git a/CommonLibs/trx_vty.h b/CommonLibs/trx_vty.h
index c921722..8d251ee 100644
--- a/CommonLibs/trx_vty.h
+++ b/CommonLibs/trx_vty.h
@@ -57,6 +57,7 @@
double offset;
double rssi_offset;
bool swap_channels;
+   bool ext_rach;
bool egprs;
unsigned int sched_rr;
unsigned int num_chans;
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index d6ddce8..28d1a30 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -159,7 +159,8 @@
  * are still expected to report clock indications through control channel
  * activity.
  */
-bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay, 
bool edge)
+bool Transceiver::init(FillerType filler, size_t rtsc, unsigned rach_delay,
+   bool edge, bool ext_rach)
 {
   int d_srcport, d_dstport, c_srcport, c_dstport;

@@ -173,6 +174,7 @@
 return false;
   }

+  mExtRACH = ext_rach;
   mEdge = edge;

   mDataSockets.resize(mChans);
@@ -583,6 +585,10 @@
   if (mEdge && (type == TSC))
 type = EDGE;

+  /* Enable extended (11-bit) RACH detection if required */
+  if (mExtRACH && (type == RACH))
+type = EXT_RACH;
+
   /* Debug: dump bursts to disk */
   /* bits 0-7  - chan 0 timeslots
* bits 8-15 - chan 1 timeslots */
@@ -635,9 +641,11 @@
 noise = 20.0 * log10(rxFullScale / state->mNoiseLev);
   }

+  unsigned max_toa = (type == 

Change in osmo-trx[master]: sigProcLib: add a CorrType for extended (11-bit) RACH

2018-10-21 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11422


Change subject: sigProcLib: add a CorrType for extended (11-bit) RACH
..

sigProcLib: add a CorrType for extended (11-bit) RACH

This is a preparatory change that enables a possibility to choose
the amount of synch. sequences to be used for Access Burst (RACH)
detection. The VTY flag will be introduced in further changes.

There are two correlation types now:

  - RACH (default) - TS0 only;
  - EXT_RACH - all TS0, TS1, and TS2 together.

Change-Id: Ia4f20524350bb8c380d7e10360758eddae8b03e9
Related: OS#3054
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 12 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/22/11422/1

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 072fb3b..28c4ded 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1602,18 +1602,22 @@
  *   tail: Search 8 symbols + maximum expected delay
  */
 static int detectRACHBurst(const signalVector , float threshold, int sps,
-   complex , float , unsigned max_toa)
+   complex , float , unsigned max_toa, 
bool ext)
 {
   int rc, target, head, tail;
-  CorrelationSequence *sync;
+  int i, num_seq;

   target = 8 + 40;
   head = 8;
   tail = 8 + max_toa;
-  sync = gRACHSequences[0];
+  num_seq = ext ? 3 : 1;

-  rc = detectGeneralBurst(burst, threshold, sps, amplitude, toa,
-  target, head, tail, sync);
+  for (i = 0; i < num_seq; i++) {
+rc = detectGeneralBurst(burst, threshold, sps, amplitude, toa,
+target, head, tail, gRACHSequences[i]);
+if (rc > 0)
+  break;
+  }

   return rc;
 }
@@ -1682,9 +1686,10 @@
 rc = analyzeTrafficBurst(burst, tsc, threshold, sps,
  amp, toa, max_toa);
 break;
+  case EXT_RACH:
   case RACH:
 rc = detectRACHBurst(burst, threshold, sps, amp, toa,
- max_toa);
+ max_toa, type == EXT_RACH);
 break;
   default:
 LOG(ERR) << "Invalid correlation type";
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 9bc7e10..79a5c3f 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -29,6 +29,7 @@
 enum CorrType{
   OFF, ///< timeslot is off
   TSC, ///< timeslot should contain a normal burst
+  EXT_RACH,///< timeslot should contain an extended access burst
   RACH,///< timeslot should contain an access burst
   EDGE,///< timeslot should contain an EDGE burst
   IDLE ///< timeslot is an idle (or dummy) burst

--
To view, visit https://gerrit.osmocom.org/11422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4f20524350bb8c380d7e10360758eddae8b03e9
Gerrit-Change-Number: 11422
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 


Build failed in Jenkins: master-asn1c » a1=default,a2=default,a3=default,osmocom-master-debian9 #283

2018-10-21 Thread jenkins
See 


--
[...truncated 3.67 KB...]

+ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking 

Change in libosmo-sccp[master]: build: move include/{mtp, sccp} to include/osmocom/

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11120 )

Change subject: build: move include/{mtp,sccp} to include/osmocom/
..

build: move include/{mtp,sccp} to include/osmocom/

Anywhere else in the Osmocom code base, we arrange headers in
include/osmocom/foo/ and pass -I ${root_srcdir}/include/.
This way including an osmocom header always has the format
  #include 
whether we are including from the local source tree or from $prefix.

For some reason not clear to me, the mtp and sccp folders, even though they are
being installed to $prefix/include/osmocom/, were kept *next* to the osmocom/
dir, instead of inside it. Fix that weird situation.

The motivation is that I wanted to use a definition from sccp_types.h in a
public-API header. That is impossible if it requires
  #include 
in a local build, but
  #include 
for any other source tree using libosmo-sccp. After this patch, both are
identical and including works without quirks. (The other patch that needed this
has changed in the meantime on and no longer needs this, but this still makes
sense for future hacking.)

The installed result does not change, since both mtp/*.h and sccp/*.h have
always been installed to $prefix/include/osmocom/{mtp,sccp}/. This merely
changes their position in the source tree.

The most curious situation before this is that any patch #including
 might not get a notice that the header didn't
exist, but might instead include an older system-installed file.

Change-Id: I1209a4ecf9f692a8030b5c93cd281fc9dd58d105
---
M configure.ac
M include/Makefile.am
M include/osmocom/Makefile.am
R include/osmocom/mtp/Makefile.am
R include/osmocom/mtp/mtp_level3.h
R include/osmocom/mtp/mtp_pcap.h
R include/osmocom/sccp/Makefile.am
R include/osmocom/sccp/sccp.h
R include/osmocom/sccp/sccp_types.h
M src/mtp_pcap.c
M src/sccp.c
M src/sccp2sua.c
M src/sccp_sclc.c
M src/sccp_scoc.c
M src/sccp_scrc.c
M tests/mtp/mtp_parse_test.c
M tests/sccp/sccp_test.c
17 files changed, 12 insertions(+), 12 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index 7dfb266..acef6f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,9 +136,9 @@
 libosmo-sccp.pc
 libosmo-mtp.pc
 libosmo-xua.pc
-include/sccp/Makefile
-include/mtp/Makefile
 include/osmocom/Makefile
+include/osmocom/sccp/Makefile
+include/osmocom/mtp/Makefile
 include/osmocom/sigtran/Makefile
 include/Makefile
 src/Makefile
diff --git a/include/Makefile.am b/include/Makefile.am
index 7cd4b57..3578a80 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1 +1 @@
-SUBDIRS = sccp mtp osmocom
+SUBDIRS = osmocom
diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am
index 7e86a4b..c4535f3 100644
--- a/include/osmocom/Makefile.am
+++ b/include/osmocom/Makefile.am
@@ -1 +1 @@
-SUBDIRS = sigtran
+SUBDIRS = mtp sccp sigtran
diff --git a/include/mtp/Makefile.am b/include/osmocom/mtp/Makefile.am
similarity index 100%
rename from include/mtp/Makefile.am
rename to include/osmocom/mtp/Makefile.am
diff --git a/include/mtp/mtp_level3.h b/include/osmocom/mtp/mtp_level3.h
similarity index 100%
rename from include/mtp/mtp_level3.h
rename to include/osmocom/mtp/mtp_level3.h
diff --git a/include/mtp/mtp_pcap.h b/include/osmocom/mtp/mtp_pcap.h
similarity index 100%
rename from include/mtp/mtp_pcap.h
rename to include/osmocom/mtp/mtp_pcap.h
diff --git a/include/sccp/Makefile.am b/include/osmocom/sccp/Makefile.am
similarity index 100%
rename from include/sccp/Makefile.am
rename to include/osmocom/sccp/Makefile.am
diff --git a/include/sccp/sccp.h b/include/osmocom/sccp/sccp.h
similarity index 100%
rename from include/sccp/sccp.h
rename to include/osmocom/sccp/sccp.h
diff --git a/include/sccp/sccp_types.h b/include/osmocom/sccp/sccp_types.h
similarity index 100%
rename from include/sccp/sccp_types.h
rename to include/osmocom/sccp/sccp_types.h
diff --git a/src/mtp_pcap.c b/src/mtp_pcap.c
index e83e6f7..a59efc5 100644
--- a/src/mtp_pcap.c
+++ b/src/mtp_pcap.c
@@ -22,7 +22,7 @@
  *
  */

-#include 
+#include 

 #include 

diff --git a/src/sccp.c b/src/sccp.c
index a15a84b..8c3641c 100644
--- a/src/sccp.c
+++ b/src/sccp.c
@@ -31,7 +31,7 @@
 #include 
 #include 

-#include 
+#include 

 // Unassigned debug area
 static int DSCCP = 0;
diff --git a/src/sccp2sua.c b/src/sccp2sua.c
index 2f5b687..f68f9a9 100644
--- a/src/sccp2sua.c
+++ b/src/sccp2sua.c
@@ -27,7 +27,7 @@
 #include 
 #include 

-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/src/sccp_sclc.c b/src/sccp_sclc.c
index e4dbae6..db67660 100644
--- a/src/sccp_sclc.c
+++ b/src/sccp_sclc.c
@@ -56,7 +56,7 @@

 #include 
 #include 
-#include 
+#include 

 #include "xua_internal.h"
 #include "sccp_internal.h"
diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index 8138e43..fbbad49 100644
--- 

Change in libosmocore[master]: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11325 )

Change subject: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()
..

libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

Missing (unset) type of to be encoded message is not a memory
allocation failure (-ENOMEM), this is definitely a mistake.

Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
---
M src/gsm/gsup.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 9c2f817..18b3580 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -535,7 +535,7 @@

/* generic part */
if(!gsup_msg->message_type)
-   return -ENOMEM;
+   return -EINVAL;

msgb_v_put(msg, gsup_msg->message_type);


--
To view, visit https://gerrit.osmocom.org/11325
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 


Change in libosmocore[master]: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11325 )

Change subject: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11325
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:56:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

2018-10-21 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11325 )

Change subject: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()
..


Patch Set 2:

We can use __attribute__((warn_unused_result)) to force caller to check for 
return value.


--
To view, visit https://gerrit.osmocom.org/11325
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:43:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

2018-10-21 Thread Vadim Yanitskiy
Hello Max, Jenkins Builder,

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

https://gerrit.osmocom.org/11325

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

Change subject: libosmogsm/gsup.c: fix error code in osmo_gsup_encode()
..

libosmogsm/gsup.c: fix error code in osmo_gsup_encode()

Missing (unset) type of to be encoded message is not a memory
allocation failure (-ENOMEM), this is definitely a mistake.

Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
---
M src/gsm/gsup.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/11325/2
--
To view, visit https://gerrit.osmocom.org/11325
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Harald Welte 


Change in osmo-sgsn[master]: gtphub: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11385 )

Change subject: gtphub: Add --version cmdline option
..

gtphub: Add --version cmdline option

Related: OS#3576
Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
---
M src/gprs/gtphub_main.c
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c
index a1a2c1d..f824016 100644
--- a/src/gprs/gtphub_main.c
+++ b/src/gprs/gtphub_main.c
@@ -238,6 +238,7 @@
printf("  -e,--log-level   Set a global log level.\n");
printf("  -r,--restart-file  File for counting restarts [%s].\n",
   ccfg->restart_counter_file);
+   printf("  -V,--version Print the version number.\n");
 }

 static void list_categories(void)
@@ -265,10 +266,11 @@
{"timestamp", 0, 0, 'T'},
{"log-level", 1, 0, 'e'},
{"restart-file", 1, 0, 'r'},
+   { "version", 0, 0, 'V' },
{NULL, 0, 0, 0}
};

-   c = getopt_long(argc, argv, "hd:Dc:sTe:r:",
+   c = getopt_long(argc, argv, "hd:Dc:sTe:r:V",
long_options, _index);
if (c == -1) {
if (optind < argc) {
@@ -310,6 +312,10 @@
case 'r':
ccfg->restart_counter_file = optarg;
break;
+   case 'V':
+   print_version(1);
+   exit(EXIT_SUCCESS);
+   break;
default:
LOGP(DGTPHUB, LOGL_FATAL, "Invalid command line 
argument, abort.\n");
exit(1);

--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 3
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-sgsn[master]: gtphub: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11385 )

Change subject: gtphub: Add --version cmdline option
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:36:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: gtphub: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has uploaded a new patch set (#2) to the change originally created 
by osmith. ( https://gerrit.osmocom.org/11385 )

Change subject: gtphub: Add --version cmdline option
..

gtphub: Add --version cmdline option

Related: OS#3576
Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
---
M src/gprs/gtphub_main.c
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/85/11385/2
--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in simtrace2[master]: remsim: fix TPDU response size transmission

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11362 )

Change subject: remsim: fix TPDU response size transmission
..

remsim: fix TPDU response size transmission

the TDPU response data size can be up to 256.
this length cannot be stored in a uint8_t, which would cause the
length to become 0, no data being send, and the reader reset the
card because of misbehaviour of the card (i.e. no/malformed
response leading to the timeout of the waiting time).

Change-Id: Iae7671085aaa3115a02d82530dd7a0e7e2d4155e
---
M host/simtrace2-remsim.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index d0bbb8c..73a7272 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -218,7 +218,7 @@

 /*! \brief Request the SIMtrace2 to transmit a Procedure Byte, then Tx */
 static int cardem_request_pb_and_tx(struct cardem_inst *ci, uint8_t pb,
-   const uint8_t *data, uint8_t data_len_in)
+   const uint8_t *data, uint16_t data_len_in)
 {
struct msgb *msg = st_msgb_alloc();
struct cardemu_usb_msg_tx_data *txd;

--
To view, visit https://gerrit.osmocom.org/11362
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iae7671085aaa3115a02d82530dd7a0e7e2d4155e
Gerrit-Change-Number: 11362
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: SGsAP protocol definitions (header + C file)

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11412 )

Change subject: SGsAP protocol definitions (header + C file)
..

SGsAP protocol definitions (header + C file)

Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
---
M include/Makefile.am
A include/osmocom/gsm/protocol/gsm_29_118.h
M src/gsm/Makefile.am
A src/gsm/gsm29118.c
M src/gsm/libosmogsm.map
5 files changed, 304 insertions(+), 1 deletion(-)

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



diff --git a/include/Makefile.am b/include/Makefile.am
index 19695d1..59a5fed 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -114,6 +114,7 @@
osmocom/gsm/protocol/gsm_09_02.h \
osmocom/gsm/protocol/gsm_12_21.h \
   osmocom/gsm/protocol/gsm_23_003.h \
+  osmocom/gsm/protocol/gsm_29_118.h \
osmocom/gsm/protocol/gsm_44_318.h \
osmocom/gsm/protocol/ipaccess.h \
osmocom/gsm/protocol/smpp34_osmocom.h \
diff --git a/include/osmocom/gsm/protocol/gsm_29_118.h 
b/include/osmocom/gsm/protocol/gsm_29_118.h
new file mode 100644
index 000..24e9de2
--- /dev/null
+++ b/include/osmocom/gsm/protocol/gsm_29_118.h
@@ -0,0 +1,169 @@
+#pragma once
+
+
+/* TS 29.118 Section 9.2 */
+enum sgsap_msg_type {
+   /* unassigned */
+   SGSAP_MSGT_PAGING_REQ   = 0x01,
+   SGSAP_MSGT_PAGING_REJ   = 0x02,
+   /* unassigned */
+   SGSAP_MSGT_SERVICE_REQ  = 0x06,
+   SGSAP_MSGT_DL_UD= 0x07,
+   SGSAP_MSGT_UL_UD= 0x08,
+   SGSAP_MSGT_LOC_UPD_REQ  = 0x09,
+   SGSAP_MSGT_LOC_UPD_ACK  = 0x0a,
+   SGSAP_MSGT_LOC_UPD_REJ  = 0x0b,
+   SGSAP_MSGT_TMSI_REALL_CMPL  = 0x0c,
+   SGSAP_MSGT_ALERT_REQ= 0x0d,
+   SGSAP_MSGT_ALERT_ACK= 0x0e,
+   SGSAP_MSGT_ALERT_REJ= 0x0f,
+   SGSAP_MSGT_UE_ACT_IND   = 0x10,
+   SGSAP_MSGT_EPS_DET_IND  = 0x11,
+   SGSAP_MSGT_EPS_DET_ACK  = 0x12,
+   SGSAP_MSGT_IMSI_DET_IND = 0x13,
+   SGSAP_MSGT_IMSI_DET_ACK = 0x14,
+   SGSAP_MSGT_RESET_IND= 0x15,
+   SGSAP_MSGT_RESET_ACK= 0x16,
+   SGSAP_MSGT_SERVICE_ABORT_REQ= 0x17,
+   SGSAP_MSGT_MO_CSFB_IND  = 0x18,
+   /* unassigned */
+   SGSAP_MSGT_MM_INFO_REQ  = 0x1a,
+   SGSAP_MSGT_RELEASE_REQ  = 0x1b,
+   /* unassigned */
+   SGSAP_MSGT_STATUS   = 0x1d,
+   /* unassigned */
+   SGSAP_MSGT_UE_UNREACHABLE   = 0x1f,
+};
+const struct value_string sgsap_msg_type_names[];
+static inline const char *sgsap_msg_type_name(enum sgsap_msg_type msgt) {
+   return get_value_string(sgsap_msg_type_names, msgt);
+}
+
+/* TS 29.118 Section 9.3 */
+enum sgsap_iei {
+   SGSAP_IE_IMSI   = 0x01,
+   SGSAP_IE_VLR_NAME   = 0x02,
+   SGSAP_IE_TMSI   = 0x03,
+   SGSAP_IE_LAI= 0x04,
+   SGSAP_IE_CHAN_NEEDED= 0x05,
+   SGSAP_IE_EMLPP_PRIORITY = 0x06,
+   SGSAP_IE_TMSI_STATUS= 0x07,
+   SGSAP_IE_SGS_CAUSE  = 0x08,
+   SGSAP_IE_MME_NAME   = 0x09,
+   SGSAP_IE_EPS_LU_TYPE= 0x0a,
+   SGSAP_IE_GLOBAL_CN_ID   = 0x0b,
+   SGSAP_IE_MOBILE_ID  = 0x0e,
+   SGSAP_IE_REJECT_CAUSE   = 0x0f,
+   SGSAP_IE_IMSI_DET_EPS_TYPE  = 0x10,
+   SGSAP_IE_IMSI_DET_NONEPS_TYPE   = 0x11,
+   SGSAP_IE_IMEISV = 0x15,
+   SGSAP_IE_NAS_MSG_CONTAINER  = 0x16,
+   SGSAP_IE_MM_INFO= 0x17,
+   SGSAP_IE_ERR_MSG= 0x1b,
+   SGSAP_IE_CLI= 0x1c,
+   SGSAP_IE_LCS_CLIENT_ID  = 0x1d,
+   SGSAP_IE_LCS_INDICATOR  = 0x1e,
+   SGSAP_IE_SS_CODE= 0x1f,
+   SGSAP_IE_SERVICE_INDICATOR  = 0x20,
+   SGSAP_IE_UE_TIMEZONE= 0x21,
+   SGSAP_IE_MS_CLASSMARK2  = 0x22,
+   SGSAP_IE_TAI= 0x23,
+   SGSAP_IE_EUTRAN_CGI = 0x24,
+   SGSAP_IE_UE_EMM_MODE= 0x25,
+   SGSAP_IE_ADDL_PAGING_INDICATORS = 0x26,
+   SGSAP_IE_TMSI_BASED_NRI_CONT= 0x27,
+};
+
+
+/* TS 29.118 

Change in libosmo-sccp[master]: build: move include/{mtp, sccp} to include/osmocom/

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11120 )

Change subject: build: move include/{mtp,sccp} to include/osmocom/
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11120
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1209a4ecf9f692a8030b5c93cd281fc9dd58d105
Gerrit-Change-Number: 11120
Gerrit-PatchSet: 5
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:34:35 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: handover_decision_2.c: implement HO to remote BSS

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11321 )

Change subject: handover_decision_2.c: implement HO to remote BSS
..

handover_decision_2.c: implement HO to remote BSS

Implement basic support for inter-BSC HO from handover_decision_2: do inter-BSC
handover only when rxlev / rxqual / ta drop below the minimum requirements.

I considered adding a vty config flag to disable/enable remote-BSS handover,
but to avoid inter-BSC HO the user can simply refrain from configuring
neighbors for a particular cell.

In collect_assignment_candidate(), it is important to clear out any new
candidate entry. Hence adopt the same pattern as below: first compose a new
(cleared) candidate, then write the entry into the list.

Related: OS#3638
Change-Id: Id78ac1b2016998a2931a23d62ec7a3f37bb764c6
---
M src/osmo-bsc/handover_decision_2.c
1 file changed, 185 insertions(+), 28 deletions(-)

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



diff --git a/src/osmo-bsc/handover_decision_2.c 
b/src/osmo-bsc/handover_decision_2.c
index 457d57a..a8fff63 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -98,8 +98,9 @@

 struct ho_candidate {
struct gsm_lchan *lchan;/* candidate for whom */
+   struct neighbor_ident_key nik;  /* neighbor ARFCN+BSIC */
struct gsm_bts *bts;/* target BTS in local BSS */
-   struct gsm0808_cell_id_list2 *cil; /* target cells in remote BSS */
+   const struct gsm0808_cell_id_list2 *cil; /* target cells in remote BSS 
*/
uint8_t requirements;   /* what is fulfilled */
int avg;/* average RX level */
 };
@@ -619,6 +620,75 @@
return requirement;
 }

+static uint8_t check_requirements_remote_bss(struct gsm_lchan *lchan,
+const struct gsm0808_cell_id_list2 
*cil)
+{
+   uint8_t requirement = 0;
+   unsigned int penalty_time;
+
+   /* Requirement A */
+
+   /* the handover penalty timer must not run for this bts */
+   penalty_time = conn_penalty_time_remaining(lchan->conn, cil);
+   if (penalty_time) {
+   LOGPHOLCHANTOREMOTE(lchan, cil, LOGL_DEBUG,
+   "not a candidate, target BSS still in 
penalty time"
+   " (%u seconds left)\n", penalty_time);
+   return 0;
+   }
+
+   /* compatibility check for codecs -- we have no notion of what the 
remote BSS supports. We can
+* only assume that a handover would work, and use only the local 
requirements. */
+   switch (lchan->tch_mode) {
+   case GSM48_CMODE_SPEECH_V1:
+   switch (lchan->type) {
+   case GSM_LCHAN_TCH_F: /* mandatory */
+   requirement |= REQUIREMENT_A_TCHF;
+   break;
+   case GSM_LCHAN_TCH_H:
+   if (codec_type_is_supported(lchan->conn, 
GSM0808_SCT_HR1))
+   requirement |= REQUIREMENT_A_TCHH;
+   break;
+   default:
+   LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel 
type: neither TCH/F nor TCH/H for %s\n",
+   get_value_string(gsm48_chan_mode_names, 
lchan->tch_mode));
+   return 0;
+   }
+   break;
+   case GSM48_CMODE_SPEECH_EFR:
+   if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2))
+   requirement |= REQUIREMENT_A_TCHF;
+   break;
+   case GSM48_CMODE_SPEECH_AMR:
+   if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3))
+   requirement |= REQUIREMENT_A_TCHF;
+   if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3))
+   requirement |= REQUIREMENT_A_TCHH;
+   break;
+   default:
+   LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not even considering: src is 
not a SPEECH mode lchan\n");
+   /* FIXME: should allow handover of non-speech lchans */
+   return 0;
+   }
+
+   if (!requirement) {
+   LOGPHOLCHAN(lchan, LOGL_ERROR, "lchan doesn't fit its own 
requirements??\n");
+   return 0;
+   }
+
+   /* Requirement B and C */
+
+   /* We don't know how many timeslots are free in the remote BSS. We can 
only indicate that it
+* would work out and hope for the best. */
+   if (requirement & REQUIREMENT_A_TCHF)
+   requirement |= REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF;
+   if (requirement & REQUIREMENT_A_TCHH)
+   requirement |= REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH;
+
+   /* return mask of fulfilled requirements */
+   return requirement;
+}
+
 /* Trigger handover or assignment 

Change in osmo-bsc[master]: handover_decision_2.c: implement HO to remote BSS

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11321 )

Change subject: handover_decision_2.c: implement HO to remote BSS
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11321
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id78ac1b2016998a2931a23d62ec7a3f37bb764c6
Gerrit-Change-Number: 11321
Gerrit-PatchSet: 5
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:33:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: handover_decision_2.c: refactor trigger_*()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11320 )

Change subject: handover_decision_2.c: refactor trigger_*()
..

handover_decision_2.c: refactor trigger_*()

a) Prepare for triggering handover for any candidate, remote or local.

b) drop redundant arguments.

Change-Id: I5ba8b556703010c8e232b516285a837c999f87ef
---
M src/osmo-bsc/handover_decision_2.c
1 file changed, 18 insertions(+), 17 deletions(-)

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



diff --git a/src/osmo-bsc/handover_decision_2.c 
b/src/osmo-bsc/handover_decision_2.c
index 64fc2dd..457d57a 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -620,8 +620,10 @@
 }

 /* Trigger handover or assignment depending on the target BTS */
-static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct 
gsm_bts *new_bts, uint8_t requirements)
+static int trigger_local_ho_or_as(struct ho_candidate *c, uint8_t requirements)
 {
+   struct gsm_lchan *lchan = c->lchan;
+   struct gsm_bts *new_bts = c->bts;
struct handover_out_req req;
struct gsm_bts *current_bts = lchan->ts->trx->bts;
int afs_bias = 0;
@@ -699,6 +701,14 @@
return 0;
 }

+static int trigger_ho(struct ho_candidate *c, uint8_t requirements)
+{
+   if (c->bts)
+   return trigger_local_ho_or_as(c, requirements);
+   else
+   return 0; /* TODO: remote candidates */
+}
+
 /* verbosely log about a handover candidate */
 static inline void debug_candidate(struct ho_candidate *candidate,
   int8_t rxlev, int tchf_count, int tchh_count)
@@ -1003,8 +1013,7 @@
LOGPHOCAND(best_cand, LOGL_INFO, "Best candidate, RX level 
%d%s\n",
   rxlev2dbm(best_cand->avg),
   best_applied_afs_bias ? " (applied AHS -> AFS rxlev 
bias)" : "");
-   return trigger_handover_or_assignment(lchan, best_cand->bts,
- best_cand->requirements & 
REQUIREMENT_B_MASK);
+   return trigger_ho(best_cand, best_cand->requirements & 
REQUIREMENT_B_MASK);
}

/* select best candidate that fulfills requirement C: less or equal 
congestion after HO */
@@ -1032,8 +1041,7 @@
LOGPHOCAND(best_cand, LOGL_INFO, "Best candidate, RX level 
%d%s\n",
   rxlev2dbm(best_cand->avg),
   best_applied_afs_bias? " (applied AHS -> AFS rxlev 
bias)" : "");
-   return trigger_handover_or_assignment(lchan, best_cand->bts,
- best_cand->requirements & 
REQUIREMENT_C_MASK);
+   return trigger_ho(best_cand, best_cand->requirements & 
REQUIREMENT_C_MASK);
}

/* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're 
avoiding congestion. */
@@ -1069,8 +1077,7 @@
LOGPHOCAND(best_cand, LOGL_INFO, "Best candidate: RX level 
%d%s\n",
   rxlev2dbm(best_cand->avg),
   best_applied_afs_bias ? " (applied AHS -> AFS rxlev 
bias)" : "");
-   return trigger_handover_or_assignment(lchan, best_cand->bts,
- best_cand->requirements & 
REQUIREMENT_A_MASK);
+   return trigger_ho(best_cand, best_cand->requirements & 
REQUIREMENT_A_MASK);
}

/* Damn, all is congested, has too low RXLEV or cannot service the 
voice call due to codec
@@ -1416,8 +1423,7 @@
LOGPHOCAND(best_cand, LOGL_DEBUG, "Best candidate: RX level 
%d%s\n",
   rxlev2dbm(best_cand->avg),
   is_improved ? " (applied AHS->AFS bias)" : "");
-   trigger_handover_or_assignment(best_cand->lchan, best_cand->bts,
-   best_cand->requirements & REQUIREMENT_B_MASK);
+   trigger_ho(best_cand, best_cand->requirements & 
REQUIREMENT_B_MASK);
 #if 0
/* if there is still congestion, mark lchan as deleted
 * and redo this process */
@@ -1485,9 +1491,7 @@
LOGPHOCAND(worst_cand, LOGL_INFO, "Worst candidate: RX level %d 
from TCH/H -> TCH/F%s\n",
   rxlev2dbm(worst_cand->avg),
   is_improved ? " (applied AHS -> AFS rxlev bias)" : 
"");
-   trigger_handover_or_assignment(worst_cand->lchan,
-   worst_cand->bts,
-   worst_cand->requirements & REQUIREMENT_B_MASK);
+   trigger_ho(worst_cand, worst_cand->requirements & 
REQUIREMENT_B_MASK);
 #if 0
/* if there is still congestion, mark lchan as deleted
 * and redo this process */
@@ -1556,8 +1560,7 @@

Change in osmo-bsc[master]: handover_decision_2.c: refactor trigger_*()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11320 )

Change subject: handover_decision_2.c: refactor trigger_*()
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11320
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5ba8b556703010c8e232b516285a837c999f87ef
Gerrit-Change-Number: 11320
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:32:33 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: BTS_Tests.ttcn: fix: don't overwrite the expected meas results

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11228 )

Change subject: BTS_Tests.ttcn: fix: don't overwrite the expected meas results
..

BTS_Tests.ttcn: fix: don't overwrite the expected meas results

Since OS#2988 was fixed, we should not overwrite nor ignore the
measurement results in f_build_meas_res_tmpl().

Change-Id: Ie902bfc7619181b528eafbce367c87e0b062243a
---
M bts/BTS_Tests.ttcn
1 file changed, 0 insertions(+), 5 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index e0470ec..2f48b0f 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -1273,11 +1273,6 @@
toa256_std_dev := ?
}
}
-   /* HACK HACK HACK FIXME HACK HACK HACK see 
https://osmocom.org/issues/2988 */
-   ul_meas.rxlev_f_u := ?;
-   ul_meas.rxlev_s_u := ?;
-   ul_meas.rxq_f_u := ?;
-   ul_meas.rxq_s_u := ?;
var template RSL_IE_BS_Power bs_power := {
reserved := 0,
epc := false,

--
To view, visit https://gerrit.osmocom.org/11228
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie902bfc7619181b528eafbce367c87e0b062243a
Gerrit-Change-Number: 11228
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Assignee: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in simtrace2[master]: remsim: update copyright

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11360 )

Change subject: remsim: update copyright
..

remsim: update copyright

Change-Id: Ibcf093877ee53f8446c97bfa50c8370ceda24c53
---
M host/simtrace2-remsim.c
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 5b8204e..d0bbb8c 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -1,7 +1,8 @@
 /* simtrace2-remsim - main program for the host PC to provide a remote SIM
  * using the SIMtrace 2 firmware in card emulation mode
  *
- * (C) 2016 by Harald Welte 
+ * (C) 2016-2017 by Harald Welte 
+ * (C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -484,7 +485,8 @@
 static void print_welcome(void)
 {
printf("simtrace2-remsim - Remote SIM card forwarding\n"
-  "(C) 2010-2017 by Harald Welte \n\n");
+  "(C) 2010-2017, Harald Welte \n"
+  "(C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon 
\n\n");
 }

 static void print_help(void)

--
To view, visit https://gerrit.osmocom.org/11360
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcf093877ee53f8446c97bfa50c8370ceda24c53
Gerrit-Change-Number: 11360
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-hlr[master]: fix and re-enable osmo_hlr_subscriber_update_notify()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11233 )

Change subject: fix and re-enable osmo_hlr_subscriber_update_notify()
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11233
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7c317de8329d9a115d072fc61ddb9abc21b7e8d8
Gerrit-Change-Number: 11233
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:28:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in simtrace2[master]: remsim: add already parsed USB path argument info

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11359 )

Change subject: remsim: add already parsed USB path argument info
..

remsim: add already parsed USB path argument info

Change-Id: I03de93ebb92b1d1b5004cbe865cdf1fa0b2b23ac
---
M host/simtrace2-remsim.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 9a681b4..5b8204e 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -501,6 +501,7 @@
"\t-I\t--usb-interface\tINTERFACE_ID\n"
"\t-S\t--usb-altsetting ALTSETTING_ID\n"
"\t-A\t--usb-address\tADDRESS\n"
+   "\t-H\t--usb-path\tPATH\n"
"\n"
);
 }

--
To view, visit https://gerrit.osmocom.org/11359
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I03de93ebb92b1d1b5004cbe865cdf1fa0b2b23ac
Gerrit-Change-Number: 11359
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-hlr[master]: Store identity of VLR/SGSN in UpdateLocation

2018-10-21 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/9723 )

Change subject: Store identity of VLR/SGSN in UpdateLocation
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/9723
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib2611421f3638eadc361787af801fffe9a34bd8a
Gerrit-Change-Number: 9723
Gerrit-PatchSet: 15
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Neels Hofmeyr 


Change in osmo-hlr[master]: fix and re-enable osmo_hlr_subscriber_update_notify()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11233 )

Change subject: fix and re-enable osmo_hlr_subscriber_update_notify()
..

fix and re-enable osmo_hlr_subscriber_update_notify()

Send updated subscriber data out to exactly those GSUP clients that match the
last LU operations (depending on each client sending distinct identification).

As this adds logging on DLGSUP, also change adjacent GSUP related logging from
DMAIN to DLGSUP.

Related: OS#2785
Change-Id: I7c317de8329d9a115d072fc61ddb9abc21b7e8d8
---
M src/hlr.c
1 file changed, 42 insertions(+), 23 deletions(-)

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



diff --git a/src/hlr.c b/src/hlr.c
index 26be8d5..78d6c91 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -54,16 +54,15 @@
 void
 osmo_hlr_subscriber_update_notify(struct hlr_subscriber *subscr)
 {
-   /* FIXME: the below code can only be re-enabled after we make sure that 
an ISD
-* is only sent tot the currently serving VLR and/or SGSN (if there are 
any).
-* We cannot blindly flood the entire PLMN with this, as it would 
create subscriber
-* state in every VLR/SGSN out there, even those that have never seen 
the subscriber.
-* See https://osmocom.org/issues/3154 for details. */
-#if 0
 struct osmo_gsup_conn *co;

-   if (g_hlr->gs == NULL)
+   if (g_hlr->gs == NULL) {
+   LOGP(DLGSUP, LOGL_DEBUG,
+"IMSI %s: NOT Notifying peers of subscriber data change,"
+" there is no GSUP server\n",
+subscr->imsi);
return;
+   }

llist_for_each_entry(co, _hlr->gs->clients, list) {
struct osmo_gsup_message gsup = { };
@@ -72,20 +71,50 @@
struct msgb *msg_out;
uint8_t *peer;
int peer_len;
+   size_t peer_strlen;
+   const char *peer_compare;
enum osmo_gsup_cn_domain cn_domain;

-   if (co->supports_ps)
+   if (co->supports_ps) {
cn_domain = OSMO_GSUP_CN_DOMAIN_PS;
-   else if (co->supports_cs)
+   peer_compare = subscr->sgsn_number;
+   } else if (co->supports_cs) {
cn_domain = OSMO_GSUP_CN_DOMAIN_CS;
-   else {
-   /* We have not yet received a location update from this 
subscriber .*/
+   peer_compare = subscr->vlr_number;
+   } else {
+   /* We have not yet received a location update from this 
GSUP client.*/
continue;
}

+   peer_len = osmo_gsup_conn_ccm_get(co, , IPAC_IDTAG_SERNR);
+   if (peer_len < 0) {
+   LOGP(DLGSUP, LOGL_ERROR,
+  "IMSI='%s': cannot get peer name for connection 
%s:%u\n", subscr->imsi,
+  co && co->conn && co->conn->server? 
co->conn->server->addr : "unset",
+  co && co->conn && co->conn->server? 
co->conn->server->port : 0);
+   continue;
+   }
+
+   peer_strlen = strnlen((const char*)peer, peer_len);
+   if (strlen(peer_compare) != peer_strlen || 
strncmp(peer_compare, (const char *)peer, peer_len)) {
+   /* Mismatch. The subscriber is not subscribed with this 
GSUP client. */
+   /* I hope peer is always nul terminated... */
+   if (peer_strlen < peer_len)
+   LOGP(DLGSUP, LOGL_DEBUG,
+"IMSI %s: subscriber change: skipping %s 
peer %s\n",
+subscr->imsi, cn_domain == 
OSMO_GSUP_CN_DOMAIN_PS ? "PS" : "CS",
+osmo_quote_str((char*)peer, -1));
+   continue;
+   }
+
+   LOGP(DLGSUP, LOGL_DEBUG,
+"IMSI %s: subscriber change: notifying %s peer %s\n",
+subscr->imsi, cn_domain == OSMO_GSUP_CN_DOMAIN_PS ? "PS" : 
"CS",
+osmo_quote_str(peer_compare, -1));
+
if (osmo_gsup_create_insert_subscriber_data_msg(, 
subscr->imsi, subscr->msisdn, msisdn_enc,

sizeof(msisdn_enc), apn, sizeof(apn), cn_domain) != 0) {
-   LOGP(DMAIN, LOGL_ERROR,
+   LOGP(DLGSUP, LOGL_ERROR,
   "IMSI='%s': Cannot notify GSUP client; could not 
create gsup message "
   "for %s:%u\n", subscr->imsi,
   co && co->conn && co->conn->server? 
co->conn->server->addr : "unset",
@@ -96,7 +125,7 @@
/* Send ISD to 

Change in osmo-sgsn[master]: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11385 )

Change subject: Add --version cmdline option
..


Patch Set 1: Code-Review+1

the commit log mesage should state to *what* it's adding the --version.  After 
all, gtphub is a rather exotic binary, and not the normal sgsn that one would 
expect in absence of any explcit mention of the binary.


--
To view, visit https://gerrit.osmocom.org/11385
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icdb2bd9ec90511b51428800d17f8ce81f6804670
Gerrit-Change-Number: 11385
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:28:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11384 )

Change subject: Add --version cmdline option
..

Add --version cmdline option

Related: OS#3577
Change-Id: Ibdda54acddde0ac03e202286736d56b6fa51a365
---
M src/main.c
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/src/main.c b/src/main.c
index 560995e..0661498 100644
--- a/src/main.c
+++ b/src/main.c
@@ -81,6 +81,7 @@
printf("OsmoSIPcon: MNCC to SIP bridge\n");
printf("  -h --help\tthis text\n");
printf("  -c --config-file NAME\tThe config file to use [%s]\n", 
config_file);
+   printf("  -V --version\tPrint the version number\n");
 }

 static void handle_options(int argc, char **argv)
@@ -90,10 +91,11 @@
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"config-file", 1, 0, 'c'},
+   {"version", 0, 0, 'V' },
{NULL, 0, 0, 0}
};

-   c = getopt_long(argc, argv, "hc:",
+   c = getopt_long(argc, argv, "hc:V",
long_options, _index);
if (c == -1)
break;
@@ -105,6 +107,10 @@
case 'c':
config_file = optarg;
break;
+   case 'V':
+   print_version(1);
+   exit(EXIT_SUCCESS);
+   break;
}
}
 }

--
To view, visit https://gerrit.osmocom.org/11384
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdda54acddde0ac03e202286736d56b6fa51a365
Gerrit-Change-Number: 11384
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-sip-connector[master]: Add --version cmdline option

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11384 )

Change subject: Add --version cmdline option
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11384
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibdda54acddde0ac03e202286736d56b6fa51a365
Gerrit-Change-Number: 11384
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:27:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in docker-playground[master]: rename m3ua-test, sua-test to nplab-*-test

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11368 )

Change subject: rename m3ua-test, sua-test to nplab-*-test
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11368
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iedf9a8cd9af1da674e018a08a977490520e602de
Gerrit-Change-Number: 11368
Gerrit-PatchSet: 4
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: osmith 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:25:52 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: gsm_08_58.h: Introduce struct abis_rsl_chan_nr

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11303 )

Change subject: gsm_08_58.h: Introduce struct abis_rsl_chan_nr
..

gsm_08_58.h: Introduce struct abis_rsl_chan_nr

It will allow to make code handling chan_nr values more easier to read
and less prone to errors.
union is used to be able to get the full octet in
case we need to pass it somewhere else or encode it.

An extra union is used in struct abis_rsl_common_hdr and others to allow
using fields directly while keeping API compatibility.

Change-Id: Icd6822021207270a00106c50f8ca6b93c1250df9
---
M include/osmocom/gsm/protocol/gsm_08_58.h
1 file changed, 32 insertions(+), 3 deletions(-)

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



diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h 
b/include/osmocom/gsm/protocol/gsm_08_58.h
index c7a7d8a..cd28caf 100644
--- a/include/osmocom/gsm/protocol/gsm_08_58.h
+++ b/include/osmocom/gsm/protocol/gsm_08_58.h
@@ -31,6 +31,26 @@
  *  @{
  * \file gsm_08_58.h */

+/* Channel Number 9.3.1 */
+union abis_rsl_chan_nr {
+#if OSMO_IS_BIG_ENDIAN
+   uint8_t cbits:5,
+   tn:3;
+#elif OSMO_IS_LITTLE_ENDIAN
+   uint8_t tn:3,
+   cbits:5;
+#endif
+   uint8_t chan_nr;
+} __attribute__ ((packed));
+#define ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs0x01
+#define ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(ss)(0x02 + (ss))
+#define ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(ss) (0x04 + (ss))
+#define ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(ss) (0x08 + (ss))
+#define ABIS_RSL_CHAN_NR_CBITS_BCCH0x10
+#define ABIS_RSL_CHAN_NR_CBITS_RACH0x11
+#define ABIS_RSL_CHAN_NR_CBITS_PCH_AGCH0x12
+#define ABIS_RSL_CHAN_NR_CBITS_OSMO_PDCH   0x18 /*< non-standard, for dyn 
TS */
+
 /* Link Identifier 9.3.2 */
 union abis_rsl_link_id {
 #if OSMO_IS_BIG_ENDIAN
@@ -60,7 +80,10 @@
 struct abis_rsl_rll_hdr {
struct abis_rsl_common_hdr c;
uint8_t ie_chan;/*!< \ref RSL_IE_CHAN_NR (tag) */
-   uint8_t chan_nr;/*!< RSL channel number (value) */
+   union {
+   uint8_t chan_nr; /* API backward compat */
+   union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number 
(value) */
+   };
uint8_t ie_link_id; /*!< \ref RSL_IE_LINK_IDENT (tag) */
union {
uint8_t link_id; /* API backward compat */
@@ -73,7 +96,10 @@
 struct abis_rsl_dchan_hdr {
struct abis_rsl_common_hdr c;
uint8_t ie_chan;/*!< \ref RSL_IE_CHAN_NR (tag) */
-   uint8_t chan_nr;/*!< RSL channel number (value) */
+   union {
+   uint8_t chan_nr; /* API backward compat */
+   union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number 
(value) */
+   };
uint8_t data[0];/*!< message payload data */
 } __attribute__ ((packed));

@@ -81,7 +107,10 @@
 struct abis_rsl_cchan_hdr {
struct abis_rsl_common_hdr c;
uint8_t ie_chan;/*!< \ref RSL_IE_CHAN_NR (tag) */
-   uint8_t chan_nr;/*!< RSL channel number (value) */
+   union {
+   uint8_t chan_nr; /* API backward compat */
+   union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number 
(value) */
+   };
uint8_t data[0];/*!< message payload data */
 } __attribute__ ((packed));


--
To view, visit https://gerrit.osmocom.org/11303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd6822021207270a00106c50f8ca6b93c1250df9
Gerrit-Change-Number: 11303
Gerrit-PatchSet: 3
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 


Change in osmo-trx[master]: sigProcLib: also detect both TS1 and TS2 RACH synch. sequences

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11390 )

Change subject: sigProcLib: also detect both TS1 and TS2 RACH synch. sequences
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/11390/1/Transceiver52M/sigProcLib.cpp
File Transceiver52M/sigProcLib.cpp:

https://gerrit.osmocom.org/#/c/11390/1/Transceiver52M/sigProcLib.cpp@1615
PS1, Line 1615: sync = gRACHSequences[i];
this will have a signifinant impact on performance, at last that's what I would 
expect.  There's now three rather long correclations for the short RACH burst, 
rather than one.  I guess this requires some benchmarks/comparisons and should 
then possibly have some flag/switch whether or not we really want to enable it. 
 After all, there's no point in paying the performance penalty unless upper 
levels (BTS, PCU) actually make use of it.



--
To view, visit https://gerrit.osmocom.org/11390
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Assignee: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:24:21 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: sigProcLib: also detect both TS1 and TS2 RACH synch. sequences

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11390 )

Change subject: sigProcLib: also detect both TS1 and TS2 RACH synch. sequences
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11390
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd
Gerrit-Change-Number: 11390
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Assignee: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Tom Tsou 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:22:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: SGsAP protocol definitions (header + C file)

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11412 )

Change subject: SGsAP protocol definitions (header + C file)
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11412
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
Gerrit-Change-Number: 11412
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:21:07 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: SGsAP protocol definitions (header + C file)

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11412 )

Change subject: SGsAP protocol definitions (header + C file)
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11412
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
Gerrit-Change-Number: 11412
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:21:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11407 )

Change subject: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing
..

ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing

Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Fixes: Coverity CID#188867
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index a2ce633..26c5bcd 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -458,7 +458,11 @@
case IPAC_MSGT_ID_RESP:
DEBUGP(DLMI, "ID_RESP ");
/* parse tags, search for Unit ID */
-   ipa_ccm_id_resp_parse(, (uint8_t *)msg->l2h+1, 
msgb_l2len(msg)-1);
+   ret = ipa_ccm_id_resp_parse(, (uint8_t *)msg->l2h+1, 
msgb_l2len(msg)-1);
+   if (ret < 0) {
+   LOGP(DLINP, LOGL_ERROR, "Error parsing CCM ID RESP 
!?!\n");
+   return -EIO;
+   }
DEBUGP(DLMI, "\n");

if (!TLVP_PRESENT(, IPAC_IDTAG_UNIT)) {

-- 
To view, visit https://gerrit.osmocom.org/11407
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Gerrit-Change-Number: 11407
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11408 )

Change subject: acc_ramp: An unsigned int is always >= 0
..

acc_ramp: An unsigned int is always >= 0

Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
---
M src/osmo-bsc/acc_ramp.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo-bsc/acc_ramp.c b/src/osmo-bsc/acc_ramp.c
index ac9f02d..bc2e3fb 100644
--- a/src/osmo-bsc/acc_ramp.c
+++ b/src/osmo-bsc/acc_ramp.c
@@ -36,7 +36,7 @@
  */
 static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc == 8 || acc == 9)
return (bts->si_common.rach_control.t2 & (1 << (acc - 8)));
return (bts->si_common.rach_control.t3 & (1 << (acc)));
@@ -44,7 +44,7 @@

 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc_ramp->barred_accs & (1 << acc))
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: allowing Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs &= ~(1 << acc);
@@ -52,7 +52,7 @@

 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if ((acc_ramp->barred_accs & (1 << acc)) == 0)
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: barring Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs |= (1 << acc);

--
To view, visit https://gerrit.osmocom.org/11408
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: bssmap_handle_cipher_mode(): Don't sent reject if !conn

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11420 )

Change subject: bssmap_handle_cipher_mode(): Don't sent reject if !conn
..

bssmap_handle_cipher_mode(): Don't sent reject if !conn

We can only send a reject response if we have a valid conn.

Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Fixes: Coverity CID#188824
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 537b851..a20d5d0 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -439,7 +439,7 @@

if (!conn) {
LOGP(DMSC, LOGL_ERROR, "No lchan/msc_data in cipher mode 
command.\n");
-   goto reject;
+   return -1;
}

if (conn->ciphering_handled) {

--
To view, visit https://gerrit.osmocom.org/11420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Gerrit-Change-Number: 11420
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11409 )

Change subject: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from 
unknown MSC
..

subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC

Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Fixes: Coverity CID#188860
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 52afd54..bca9e1f 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -276,8 +276,9 @@
if (!conn->sccp.msc) {
LOGPFSML(fi, LOGL_NOTICE, "N-CONNECT.ind from unknown 
MSC %s\n",
 
osmo_sccp_addr_dump(_prim->u.connect.calling_addr));
-   osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user, 
scu_prim->u.connect.conn_id,
-_prim->u.connect.called_addr, 
0);
+   /* We cannot find a way to the sccp_user without the 
MSC, so we cannot
+* use osmo_sccp_tx_disconn() :( */
+   //osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user, 
scu_prim->u.connect.conn_id, _prim->u.connect.called_addr, 0);
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL);
return;
}

--
To view, visit https://gerrit.osmocom.org/11409
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Gerrit-Change-Number: 11409
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: ipaccess-config: Fix open() return value checking

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11421 )

Change subject: ipaccess-config: Fix open() return value checking
..

ipaccess-config: Fix open() return value checking

open() returning 0 is valid, but negative values indicate errors.

Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Fixes: Coverity CID#57865
---
M src/ipaccess/ipaccess-config.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 079bae2..5491700 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -634,7 +634,7 @@
INIT_LLIST_HEAD(entry);

fd = open(filename, O_RDONLY);
-   if (!fd) {
+   if (fd < 0) {
perror("nada");
return -1;
}
@@ -729,7 +729,7 @@

printf("Opening possible firmware '%s'\n", filename);
fd = open(filename, O_RDONLY);
-   if (!fd) {
+   if (fd < 0) {
perror("nada");
return;
}

--
To view, visit https://gerrit.osmocom.org/11421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Gerrit-Change-Number: 11421
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: libosmogsm/gsup.c: assert message type in osmo_gsup_encode()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11325 )

Change subject: libosmogsm/gsup.c: assert message type in osmo_gsup_encode()
..


Patch Set 1:

It's debatable.  -ENOMEM for sure is an odd return code for an invalid input 
value.  but yes, since any caller needs to check for the return value anyway, 
the OSMO_ASSERT() solution isn't the best option either.  Why not simply return 
-EINVAL?


--
To view, visit https://gerrit.osmocom.org/11325
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibbac18e2b68b765c17c2bc959c4c085037953a7f
Gerrit-Change-Number: 11325
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:18:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in docker-playground[master]: osmo-*-latest: s/nightly/latest/g in Dockerfile

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11364 )

Change subject: osmo-*-latest: s/nightly/latest/g in Dockerfile
..


Patch Set 1:

this repository has no job that can set the "verified" flag.  So you have to 
set V+1 manually, if you have tested the patch.  As it already has review +2, 
you can then merge it yourself.


--
To view, visit https://gerrit.osmocom.org/11364
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1eab031038927043faf6ed8ed30bdf4d4d1624d5
Gerrit-Change-Number: 11364
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:16:26 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in docker-playground[master]: Remove top-level Makefile

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11369 )

Change subject: Remove top-level Makefile
..


Patch Set 4: Verified+1


--
To view, visit https://gerrit.osmocom.org/11369
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id18a9a7a70f85127e6f6c9447d71764018bdb4ff
Gerrit-Change-Number: 11369
Gerrit-PatchSet: 4
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: osmith 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:15:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: gsm_08_08: do not include zero length speech codec list.

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11388 )

Change subject: gsm_08_08: do not include zero length speech codec list.
..

gsm_08_08: do not include zero length speech codec list.

When COMPLETE LAYER 3 INFORMATION is generated, it may include a speech
codec list that contains 0 elements (which is legal). The specification
requires the speech to be include if the network supports an IP based
user plane interface. It could be argumented that if no codecs are
available, the ip based user plane interface is not supported and
therefore the spec does not require the speech codec list IE to be
included for those cases. Lets check if the speech codec list has 0
elements and if its zero length, lets omit it completely.

- check for zero length speech codec list.
- omit speech codec list if it has zero elements

Change-Id: I07339322a71376e986a2d75b7bc1f552eafd02b5
Related: OS#3657
---
M src/osmo-bsc/gsm_08_08.c
1 file changed, 11 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 807eb8c..19c2598 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -495,7 +495,17 @@

if (gscon_is_aoip(conn)) {
gen_bss_supported_codec_list(, msc, conn_get_bts(conn));
-   resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, 
conn_get_bts(conn)), );
+   if (scl.len > 0)
+   resp = gsm0808_create_layer3_2(msg, 
cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), );
+   else {
+   /* Note: 3GPP TS 48.008 3.2.1.32, COMPLETE LAYER 3 
INFORMATION clearly states that
+* Codec List (BSS Supported) shall be included, if the 
radio access network
+* supports an IP based user plane interface. It may be 
intentional that the
+* current configuration does not support any voice 
codecs, in those cases the
+* network does not support an IP based user plane 
interface, and therefore the
+* Codec List (BSS Supported) IE can be left out in 
those situations. */
+   resp = gsm0808_create_layer3_2(msg, 
cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), NULL);
+   }
} else
resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, 
conn_get_bts(conn)), NULL);


--
To view, visit https://gerrit.osmocom.org/11388
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I07339322a71376e986a2d75b7bc1f552eafd02b5
Gerrit-Change-Number: 11388
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in libosmocore[master]: telnet_interface: avoid double-close of fd()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11416 )

Change subject: telnet_interface: avoid double-close of fd()
..

telnet_interface: avoid double-close of fd()

Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad
Fixes: Coverity CID#135238
---
M src/vty/telnet_interface.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index 0ccf8dc..fdd88c1 100644
--- a/src/vty/telnet_interface.c
+++ b/src/vty/telnet_interface.c
@@ -177,7 +177,7 @@
connection->vty = vty_create(new_connection, connection);
if (!connection->vty) {
LOGP(0, LOGL_ERROR, "couldn't create VTY\n");
-   close(new_connection);
+   /* vty_create() is already closing the fd if it returns NULL */
talloc_free(connection);
return -1;
}

--
To view, visit https://gerrit.osmocom.org/11416
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad
Gerrit-Change-Number: 11416
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: handover_start_inter_bsc_in(): Uninitialized variable

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11398 )

Change subject: handover_start_inter_bsc_in(): Uninitialized variable
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11398
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8e5b164194855f78a266c1a4441730cc6c378d11
Gerrit-Change-Number: 11398
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Sun, 21 Oct 2018 12:11:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: handover_start_inter_bsc_in(): Uninitialized variable

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11398 )

Change subject: handover_start_inter_bsc_in(): Uninitialized variable
..

handover_start_inter_bsc_in(): Uninitialized variable

This only afffects a log statement, so not really an issue.

Change-Id: I8e5b164194855f78a266c1a4441730cc6c378d11
Fixes: Coverity CID#188829
---
M src/osmo-bsc/handover_fsm.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 4286084..68230e1 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -522,7 +522,7 @@
struct handover_in_req *req = >inter_bsc_in;
int match_idx;
enum gsm48_chan_mode mode;
-   bool full_rate;
+   bool full_rate = false;
uint16_t s15_s0;
struct osmo_fsm_inst *fi;


--
To view, visit https://gerrit.osmocom.org/11398
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8e5b164194855f78a266c1a4441730cc6c378d11
Gerrit-Change-Number: 11398
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Neels Hofmeyr 


Change in osmo-bsc[master]: range_enc_determine_range(): Don't dereference array on size=0

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11397 )

Change subject: range_enc_determine_range(): Don't dereference array on size=0
..

range_enc_determine_range(): Don't dereference array on size=0

Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Fixes: Coverity CID#182710
---
M src/osmo-bsc/arfcn_range_encode.c
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/src/osmo-bsc/arfcn_range_encode.c 
b/src/osmo-bsc/arfcn_range_encode.c
index 84f9f63..54d98a9 100644
--- a/src/osmo-bsc/arfcn_range_encode.c
+++ b/src/osmo-bsc/arfcn_range_encode.c
@@ -168,6 +168,10 @@
 {
int max = 0;

+   /* don't dereference arfcns[] array if size is 0 */
+   if (size == 0)
+   return ARFCN_RANGE_128;
+
/*
 * Go for the easiest. And pick arfcns[0] == f0.
 */

--
To view, visit https://gerrit.osmocom.org/11397
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Gerrit-Change-Number: 11397
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: vty.c: Set vty->fd to -1 after closing the FD

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11417 )

Change subject: vty.c: Set vty->fd to -1 after closing the FD
..

vty.c: Set vty->fd to -1 after closing the FD

Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
---
M src/vty/vty.c
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/src/vty/vty.c b/src/vty/vty.c
index ad53537..70f6811 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -221,8 +221,10 @@
vector_unset(vtyvec, vty->fd);

/* Close socket. */
-   if (vty->fd > 0)
+   if (vty->fd > 0) {
close(vty->fd);
+   vty->fd = -1;
+   }

if (vty->buf) {
talloc_free(vty->buf);

--
To view, visit https://gerrit.osmocom.org/11417
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
Gerrit-Change-Number: 11417
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: timerfd_create(): Fix error handling of osmo_fd_register()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11413 )

Change subject: timerfd_create(): Fix error handling of osmo_fd_register()
..

timerfd_create(): Fix error handling of osmo_fd_register()

Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Closes: Coverity CID#188853
---
M src/select.c
1 file changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/src/select.c b/src/select.c
index 0b115c6..b594ca5 100644
--- a/src/select.c
+++ b/src/select.c
@@ -324,11 +324,18 @@
ofd->when = BSC_FD_READ;

if (ofd->fd < 0) {
+   int rc;
+
ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
if (ofd->fd < 0)
return ofd->fd;

-   osmo_fd_register(ofd);
+   rc = osmo_fd_register(ofd);
+   if (rc < 0) {
+   close(ofd->fd);
+   ofd->fd = -1;
+   return rc;
+   }
}
return 0;
 }

--
To view, visit https://gerrit.osmocom.org/11413
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Gerrit-Change-Number: 11413
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-msc[master]: gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11414 )

Change subject: gsm0407_is_duplicate(): Handle error ret of 
gsm0407_pdisc_ctr_bin()
..

gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()

Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4
Fixes: Coverity CID#182702
---
M src/libmsc/gsm_04_08.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 0f52d09..d5cc212 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1397,7 +1397,8 @@
 {
struct gsm48_hdr *gh;
uint8_t pdisc;
-   uint8_t n_sd, modulo, bin;
+   uint8_t n_sd, modulo;
+   int bin;

gh = msgb_l3(msg);
pdisc = gsm48_hdr_pdisc(gh);

--
To view, visit https://gerrit.osmocom.org/11414
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4
Gerrit-Change-Number: 11414
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-trx[master]: trx_validate_config(): Fix validation of rx_sps

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11406 )

Change subject: trx_validate_config(): Fix validation of rx_sps
..

trx_validate_config(): Fix validation of rx_sps

Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Fixes: Coverity CID#188871
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index d01a4cf..7f72c47 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -376,7 +376,7 @@

/* Force 4 SPS for EDGE or multi-ARFCN configurations */
if ((trx->cfg.egprs || trx->cfg.multi_arfcn) &&
-   (trx->cfg.tx_sps!=4 || trx->cfg.tx_sps!=4)) {
+   (trx->cfg.tx_sps!=4 || trx->cfg.rx_sps!=4)) {
LOG(ERROR) << "EDGE and Multi-Carrier options require 4 tx and 
rx sps. Check you config.";
return -1;
}

--
To view, visit https://gerrit.osmocom.org/11406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Gerrit-Change-Number: 11406
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-pcu[master]: gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tv

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11401 )

Change subject: gprs_rlcmac_received_lost(): Fix regression / uninitialized 
now_tv
..

gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tv

In Change-Id I7d22e7b5902c230efeae66eb20c17026a4037887 we
introduced the use of timespecsub(). Unfortuantely, we also
accidentially removed the call to osmo_clock_gettime() along
with it, leaving now_tv completely uninitialized.

Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Related: OS#3225
Fixes: Coverity CID#188872
---
M src/gprs_rlcmac_meas.cpp
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp
index f6448d5..9ff06db 100644
--- a/src/gprs_rlcmac_meas.cpp
+++ b/src/gprs_rlcmac_meas.cpp
@@ -131,6 +131,7 @@
tbf->m_bw.dl_loss_received += received;
tbf->m_bw.dl_loss_lost += lost;

+   osmo_clock_gettime(CLOCK_MONOTONIC, _tv);
timespecsub(_tv, loss_tv, );
if (elapsed.tv_sec < 1)
return 0;

--
To view, visit https://gerrit.osmocom.org/11401
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Gerrit-Change-Number: 11401
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Stefan Sperling 


Change in osmo-pcu[master]: gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tv

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11401 )

Change subject: gprs_rlcmac_received_lost(): Fix regression / uninitialized 
now_tv
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11401
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Gerrit-Change-Number: 11401
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Stefan Sperling 
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:49:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11414 )

Change subject: gsm0407_is_duplicate(): Handle error ret of 
gsm0407_pdisc_ctr_bin()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11414
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4
Gerrit-Change-Number: 11414
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:49:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: trx_validate_config(): Fix validation of rx_sps

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11406 )

Change subject: trx_validate_config(): Fix validation of rx_sps
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Gerrit-Change-Number: 11406
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:49:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: trx_validate_config(): Fix validation of rx_sps

2018-10-21 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/11406

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

Change subject: trx_validate_config(): Fix validation of rx_sps
..

trx_validate_config(): Fix validation of rx_sps

Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Fixes: Coverity CID#188871
---
M Transceiver52M/osmo-trx.cpp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/06/11406/2
--
To view, visit https://gerrit.osmocom.org/11406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Gerrit-Change-Number: 11406
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-trx[master]: SocketsTest.testReaderIP(): Zero terminate received buffer

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11405 )

Change subject: SocketsTest.testReaderIP(): Zero terminate received buffer
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11405
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
Gerrit-Change-Number: 11405
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:48:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: SocketsTest.testReaderIP(): Zero terminate received buffer

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11405 )

Change subject: SocketsTest.testReaderIP(): Zero terminate received buffer
..

SocketsTest.testReaderIP(): Zero terminate received buffer

Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
---
M tests/CommonLibs/SocketsTest.cpp
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index eb92e25..e4eef54 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -47,9 +47,10 @@
readSocket->nonblocking();
int rc = 0;
while (rcread(buf, MAX_UDP_LENGTH);
if (count>0) {
+   buf[count] = 0;
CERR("read: " << buf);
rc++;
} else {

--
To view, visit https://gerrit.osmocom.org/11405
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
Gerrit-Change-Number: 11405
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bts[master]: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11415 )

Change subject: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 
0.12.0
..

scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0

Change-Id: I721d493659fde57eca1543b2e63171df1be1279d
Fixes: Coverity CID#178646
---
M configure.ac
M src/osmo-bts-trx/scheduler_trx.c
2 files changed, 10 insertions(+), 72 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index 38e6713..f2d4f84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,12 +62,12 @@
 fi

 dnl checks for libraries
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.11.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0)
 PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.5.0)

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 4bac235..fa3aed2 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -1434,68 +1434,6 @@
ts->tv_nsec = ts->tv_nsec % 10;
 }

-/*! disable the osmocom-wrapped timerfd */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_disable(struct osmo_fd *ofd)
-{
-   const struct itimerspec its_null = {
-   .it_value = { 0, 0 },
-   .it_interval = { 0, 0 },
-   };
-   return timerfd_settime(ofd->fd, 0, _null, NULL);
-}
-
-/*! schedule the osmcoom-wrapped timerfd to occur first at \a first, then 
periodically at \a interval
- *  \param[in] ofd Osmocom wrapped timerfd
- *  \param[in] first Relative time at which the timer should first execute 
(NULL = \a interval)
- *  \param[in] interval Time interval at which subsequent timer shall fire
- *  \returns 0 on success; negative on error */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_schedule(struct osmo_fd *ofd, const struct timespec 
*first,
- const struct timespec *interval)
-{
-   struct itimerspec its;
-
-   if (ofd->fd < 0)
-   return -EINVAL;
-
-   /* first expiration */
-   if (first)
-   its.it_value = *first;
-   else
-   its.it_value = *interval;
-   /* repeating interval */
-   its.it_interval = *interval;
-
-   return timerfd_settime(ofd->fd, 0, , NULL);
-}
-
-/*! setup osmocom-wrapped timerfd
- *  \param[inout] ofd Osmocom-wrapped timerfd on which to operate
- *  \param[in] cb Call-back function called when timerfd becomes readable
- *  \param[in] data Opaque data to be passed on to call-back
- *  \returns 0 on success; negative on error
- *
- *  We simply initialize the data structures here, but do not yet
- *  schedule the timer.
- */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, 
unsigned int), void *data)
-{
-   ofd->cb = cb;
-   ofd->data = data;
-   ofd->when = BSC_FD_READ;
-
-   if (ofd->fd < 0) {
-   ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
-   if (ofd->fd < 0)
-   return ofd->fd;
-
-   osmo_fd_register(ofd);
-   }
-   return 0;
-}
-
 /*! Increment a GSM frame number modulo GSM_HYPERFRAME */
 #define INCREMENT_FN(fn)   (fn) = (((fn) + 1) % GSM_HYPERFRAME)

@@ -1557,7 +1495,7 @@
return 0;

 no_clock:
-   timer_ofd_disable(>fn_timer_ofd);
+   osmo_timerfd_disable(>fn_timer_ofd);
transceiver_available = 0;

bts_shutdown(bts, "No clock from osmo-trx");
@@ -1575,8 +1513,8 @@
trx_sched_fn(bts, tcs->last_fn_timer.fn);

/* schedule first FN clock timer */
-   timer_ofd_setup(>fn_timer_ofd, trx_fn_timer_cb, bts);
-   timer_ofd_schedule(>fn_timer_ofd, NULL, interval);
+   osmo_timerfd_setup(>fn_timer_ofd, trx_fn_timer_cb, bts);
+   osmo_timerfd_schedule(>fn_timer_ofd, NULL, interval);

tcs->last_fn_timer.tv = *tv_now;
tcs->last_clk_ind.tv = *tv_now;
@@ -1666,7 +1604,7 @@
normalize_timespec();
LOGP(DL1C, 

Change in osmo-bts[master]: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11415 )

Change subject: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 
0.12.0
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11415
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I721d493659fde57eca1543b2e63171df1be1279d
Gerrit-Change-Number: 11415
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:47:18 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: timerfd_create(): Fix error handling of osmo_fd_register()

2018-10-21 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/11413

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

Change subject: timerfd_create(): Fix error handling of osmo_fd_register()
..

timerfd_create(): Fix error handling of osmo_fd_register()

Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Closes: Coverity CID#188853
---
M src/select.c
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/11413/3
--
To view, visit https://gerrit.osmocom.org/11413
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Gerrit-Change-Number: 11413
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: timerfd_create(): Fix error handling of osmo_fd_register()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11413 )

Change subject: timerfd_create(): Fix error handling of osmo_fd_register()
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11413
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Gerrit-Change-Number: 11413
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:46:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: vty.c: Set vty->fd to -1 after closing the FD

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11417 )

Change subject: vty.c: Set vty->fd to -1 after closing the FD
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11417
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
Gerrit-Change-Number: 11417
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:44:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: telnet_interface: avoid double-close of fd()

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11416 )

Change subject: telnet_interface: avoid double-close of fd()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11416
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad
Gerrit-Change-Number: 11416
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:44:32 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ggsn[master]: sgsnemu: Fix printing of tun device name

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11418 )

Change subject: sgsnemu: Fix printing of tun device name
..

sgsnemu: Fix printing of tun device name

Change-Id: I6cd89b7b59a6c1d506cfbe9d3088cb844d133313
Fixes: Coverity CID#178638
---
M sgsnemu/sgsnemu.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 1e61a09..a2220f0 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -293,7 +293,7 @@
printf("timelimit: %d\n", args_info.timelimit_arg);
printf("createif: %d\n", args_info.createif_flag);
if (args_info.tun_device_arg)
-   printf("tun-device: %d\n", args_info.tun_device_arg);
+   printf("tun-device: %s\n", args_info.tun_device_arg);
if (args_info.ipup_arg)
printf("ipup: %s\n", args_info.ipup_arg);
if (args_info.ipdown_arg)

--
To view, visit https://gerrit.osmocom.org/11418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6cd89b7b59a6c1d506cfbe9d3088cb844d133313
Gerrit-Change-Number: 11418
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ggsn[master]: sgsnemu: Fix printing of tun device name

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11418 )

Change subject: sgsnemu: Fix printing of tun device name
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6cd89b7b59a6c1d506cfbe9d3088cb844d133313
Gerrit-Change-Number: 11418
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: ipaccess-config: Fix open() return value checking

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11421 )

Change subject: ipaccess-config: Fix open() return value checking
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Gerrit-Change-Number: 11421
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ggsn[master]: ippool.c: Use "%td" format string for ptrdiff_t

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11419 )

Change subject: ippool.c: Use "%td" format string for ptrdiff_t
..

ippool.c: Use "%td" format string for ptrdiff_t

Change-Id: Iacafa0919baebac6b5a799deb41a673c022c6743
Fixes: Coverity CID#135225
---
M lib/ippool.c
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/lib/ippool.c b/lib/ippool.c
index a9a64be..6561f1f 100644
--- a/lib/ippool.c
+++ b/lib/ippool.c
@@ -26,16 +26,16 @@
 {
unsigned int n;
printf("ippool_printaddr\n");
-   printf("Firstdyn %d\n", this->firstdyn - this->member);
-   printf("Lastdyn %d\n", this->lastdyn - this->member);
-   printf("Firststat %d\n", this->firststat - this->member);
-   printf("Laststat %d\n", this->laststat - this->member);
-   printf("Listsize %d\n", this->listsize);
+   printf("Firstdyn %td\n", this->firstdyn - this->member);
+   printf("Lastdyn %td\n", this->lastdyn - this->member);
+   printf("Firststat %td\n", this->firststat - this->member);
+   printf("Laststat %td\n", this->laststat - this->member);
+   printf("Listsize %td\n", this->listsize);

for (n = 0; n < this->listsize; n++) {
char s[256];
in46a_ntop(>member[n].addr, s, sizeof(s));
-   printf("Unit %d inuse %d prev %d next %d addr %s\n",
+   printf("Unit %d inuse %d prev %td next %td addr %s\n",
   n,
   this->member[n].inuse,
   this->member[n].prev - this->member,

--
To view, visit https://gerrit.osmocom.org/11419
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iacafa0919baebac6b5a799deb41a673c022c6743
Gerrit-Change-Number: 11419
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ggsn[master]: ippool.c: Use "%td" format string for ptrdiff_t

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11419 )

Change subject: ippool.c: Use "%td" format string for ptrdiff_t
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11419
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iacafa0919baebac6b5a799deb41a673c022c6743
Gerrit-Change-Number: 11419
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:48 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: bssmap_handle_cipher_mode(): Don't sent reject if !conn

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11420 )

Change subject: bssmap_handle_cipher_mode(): Don't sent reject if !conn
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Gerrit-Change-Number: 11420
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: range_enc_determine_range(): Don't dereference array on size=0

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11397 )

Change subject: range_enc_determine_range(): Don't dereference array on size=0
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11397
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Gerrit-Change-Number: 11397
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:42:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11407 )

Change subject: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11407
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Gerrit-Change-Number: 11407
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:42:56 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11408 )

Change subject: acc_ramp: An unsigned int is always >= 0
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11408
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11409 )

Change subject: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from 
unknown MSC
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11409
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Gerrit-Change-Number: 11409
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:43:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: check_rtp_origin(): Avoid using memcmp for comparing integer types

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11403 )

Change subject: check_rtp_origin(): Avoid using memcmp for comparing integer 
types
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11403
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic6105d39ae2fb4b301f87448b16763fe9f695621
Gerrit-Change-Number: 11403
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:42:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-mgw[master]: check_rtp_origin(): Don't memcmp sockadd_in and in_addr

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11402 )

Change subject: check_rtp_origin(): Don't memcmp sockadd_in and in_addr
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11402
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic64256619ef893d625400e8b1b573ea2c629ed9c
Gerrit-Change-Number: 11402
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:42:20 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-iuh[master]: hnbgw_tx_hnb_register_rej(): Missing return statement

2018-10-21 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11400 )

Change subject: hnbgw_tx_hnb_register_rej(): Missing return statement
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11400
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0bdee8ede9ffdc16c16a4f5723acb7b4bceb2158
Gerrit-Change-Number: 11400
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 21 Oct 2018 11:41:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ggsn[master]: sgsnemu: Use in46a_from_eua() with array of in46_addr

2018-10-21 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/11404 )

Change subject: sgsnemu: Use in46a_from_eua() with array of in46_addr
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/11404
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie5a572a507d0556736a661cd3c1216e1e2a2a5df
Gerrit-Change-Number: 11404
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-iuh[master]: hnbgw_tx_hnb_register_rej(): Missing return statement

2018-10-21 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11400 )

Change subject: hnbgw_tx_hnb_register_rej(): Missing return statement
..

hnbgw_tx_hnb_register_rej(): Missing return statement

Change-Id: I0bdee8ede9ffdc16c16a4f5723acb7b4bceb2158
Fixes: Coverity CID#188869
---
M src/hnbgw_hnbap.c
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c
index 2a19dda..1d50d4d 100644
--- a/src/hnbgw_hnbap.c
+++ b/src/hnbgw_hnbap.c
@@ -85,7 +85,10 @@
} else {
/* The message was not queued. Destroy the connection right 
away. */
hnb_context_release(ctx);
+   return rc;
}
+
+   return 0;
 }

 static int hnbgw_tx_hnb_register_acc(struct hnb_context *ctx)

--
To view, visit https://gerrit.osmocom.org/11400
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0bdee8ede9ffdc16c16a4f5723acb7b4bceb2158
Gerrit-Change-Number: 11400
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: bssmap_handle_cipher_mode(): Don't sent reject if !conn

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11420


Change subject: bssmap_handle_cipher_mode(): Don't sent reject if !conn
..

bssmap_handle_cipher_mode(): Don't sent reject if !conn

We can only send a reject response if we have a valid conn.

Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Fixes: Coverity CID#188824
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/20/11420/1

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 537b851..a20d5d0 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -439,7 +439,7 @@

if (!conn) {
LOGP(DMSC, LOGL_ERROR, "No lchan/msc_data in cipher mode 
command.\n");
-   goto reject;
+   return -1;
}

if (conn->ciphering_handled) {

--
To view, visit https://gerrit.osmocom.org/11420
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Gerrit-Change-Number: 11420
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-bsc[master]: ipaccess-config: Fix open() return value checking

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11421


Change subject: ipaccess-config: Fix open() return value checking
..

ipaccess-config: Fix open() return value checking

open() returning 0 is valid, but negative values indicate errors.

Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Fixes: Coverity CID#57865
---
M src/ipaccess/ipaccess-config.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/11421/1

diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 079bae2..5491700 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -634,7 +634,7 @@
INIT_LLIST_HEAD(entry);

fd = open(filename, O_RDONLY);
-   if (!fd) {
+   if (fd < 0) {
perror("nada");
return -1;
}
@@ -729,7 +729,7 @@

printf("Opening possible firmware '%s'\n", filename);
fd = open(filename, O_RDONLY);
-   if (!fd) {
+   if (fd < 0) {
perror("nada");
return;
}

--
To view, visit https://gerrit.osmocom.org/11421
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Gerrit-Change-Number: 11421
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-ggsn[master]: sgsnemu: Fix printing of tun device name

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11418


Change subject: sgsnemu: Fix printing of tun device name
..

sgsnemu: Fix printing of tun device name

Change-Id: I6cd89b7b59a6c1d506cfbe9d3088cb844d133313
Fixes: Coverity CID#178638
---
M sgsnemu/sgsnemu.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/18/11418/1

diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 1e61a09..a2220f0 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -293,7 +293,7 @@
printf("timelimit: %d\n", args_info.timelimit_arg);
printf("createif: %d\n", args_info.createif_flag);
if (args_info.tun_device_arg)
-   printf("tun-device: %d\n", args_info.tun_device_arg);
+   printf("tun-device: %s\n", args_info.tun_device_arg);
if (args_info.ipup_arg)
printf("ipup: %s\n", args_info.ipup_arg);
if (args_info.ipdown_arg)

--
To view, visit https://gerrit.osmocom.org/11418
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cd89b7b59a6c1d506cfbe9d3088cb844d133313
Gerrit-Change-Number: 11418
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-ggsn[master]: ippool.c: Use "%td" format string for ptrdiff_t

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11419


Change subject: ippool.c: Use "%td" format string for ptrdiff_t
..

ippool.c: Use "%td" format string for ptrdiff_t

Change-Id: Iacafa0919baebac6b5a799deb41a673c022c6743
Fixes: Coverity CID#135225
---
M lib/ippool.c
1 file changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/19/11419/1

diff --git a/lib/ippool.c b/lib/ippool.c
index a9a64be..6561f1f 100644
--- a/lib/ippool.c
+++ b/lib/ippool.c
@@ -26,16 +26,16 @@
 {
unsigned int n;
printf("ippool_printaddr\n");
-   printf("Firstdyn %d\n", this->firstdyn - this->member);
-   printf("Lastdyn %d\n", this->lastdyn - this->member);
-   printf("Firststat %d\n", this->firststat - this->member);
-   printf("Laststat %d\n", this->laststat - this->member);
-   printf("Listsize %d\n", this->listsize);
+   printf("Firstdyn %td\n", this->firstdyn - this->member);
+   printf("Lastdyn %td\n", this->lastdyn - this->member);
+   printf("Firststat %td\n", this->firststat - this->member);
+   printf("Laststat %td\n", this->laststat - this->member);
+   printf("Listsize %td\n", this->listsize);

for (n = 0; n < this->listsize; n++) {
char s[256];
in46a_ntop(>member[n].addr, s, sizeof(s));
-   printf("Unit %d inuse %d prev %d next %d addr %s\n",
+   printf("Unit %d inuse %d prev %td next %td addr %s\n",
   n,
   this->member[n].inuse,
   this->member[n].prev - this->member,

--
To view, visit https://gerrit.osmocom.org/11419
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacafa0919baebac6b5a799deb41a673c022c6743
Gerrit-Change-Number: 11419
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: telnet_interface: avoid double-close of fd()

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11416


Change subject: telnet_interface: avoid double-close of fd()
..

telnet_interface: avoid double-close of fd()

Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad
Fixes: Coverity CID#135238
---
M src/vty/telnet_interface.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/11416/1

diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index 0ccf8dc..fdd88c1 100644
--- a/src/vty/telnet_interface.c
+++ b/src/vty/telnet_interface.c
@@ -177,7 +177,7 @@
connection->vty = vty_create(new_connection, connection);
if (!connection->vty) {
LOGP(0, LOGL_ERROR, "couldn't create VTY\n");
-   close(new_connection);
+   /* vty_create() is already closing the fd if it returns NULL */
talloc_free(connection);
return -1;
}

--
To view, visit https://gerrit.osmocom.org/11416
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad
Gerrit-Change-Number: 11416
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: vty.c: Set vty->fd to -1 after closing the FD

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11417


Change subject: vty.c: Set vty->fd to -1 after closing the FD
..

vty.c: Set vty->fd to -1 after closing the FD

Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
---
M src/vty/vty.c
1 file changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/11417/1

diff --git a/src/vty/vty.c b/src/vty/vty.c
index ad53537..70f6811 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -221,8 +221,10 @@
vector_unset(vtyvec, vty->fd);

/* Close socket. */
-   if (vty->fd > 0)
+   if (vty->fd > 0) {
close(vty->fd);
+   vty->fd = -1;
+   }

if (vty->buf) {
talloc_free(vty->buf);

--
To view, visit https://gerrit.osmocom.org/11417
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
Gerrit-Change-Number: 11417
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-bts[master]: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11415


Change subject: scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 
0.12.0
..

scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0

Change-Id: I721d493659fde57eca1543b2e63171df1be1279d
Fixes: Coverity CID#178646
---
M configure.ac
M src/osmo-bts-trx/scheduler_trx.c
2 files changed, 10 insertions(+), 72 deletions(-)



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

diff --git a/configure.ac b/configure.ac
index 38e6713..f2d4f84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,12 +62,12 @@
 fi

 dnl checks for libraries
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.11.0)
-PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.11.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore  >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.12.0)
+PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0)
 PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.5.0)

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 4bac235..fa3aed2 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -1434,68 +1434,6 @@
ts->tv_nsec = ts->tv_nsec % 10;
 }

-/*! disable the osmocom-wrapped timerfd */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_disable(struct osmo_fd *ofd)
-{
-   const struct itimerspec its_null = {
-   .it_value = { 0, 0 },
-   .it_interval = { 0, 0 },
-   };
-   return timerfd_settime(ofd->fd, 0, _null, NULL);
-}
-
-/*! schedule the osmcoom-wrapped timerfd to occur first at \a first, then 
periodically at \a interval
- *  \param[in] ofd Osmocom wrapped timerfd
- *  \param[in] first Relative time at which the timer should first execute 
(NULL = \a interval)
- *  \param[in] interval Time interval at which subsequent timer shall fire
- *  \returns 0 on success; negative on error */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_schedule(struct osmo_fd *ofd, const struct timespec 
*first,
- const struct timespec *interval)
-{
-   struct itimerspec its;
-
-   if (ofd->fd < 0)
-   return -EINVAL;
-
-   /* first expiration */
-   if (first)
-   its.it_value = *first;
-   else
-   its.it_value = *interval;
-   /* repeating interval */
-   its.it_interval = *interval;
-
-   return timerfd_settime(ofd->fd, 0, , NULL);
-}
-
-/*! setup osmocom-wrapped timerfd
- *  \param[inout] ofd Osmocom-wrapped timerfd on which to operate
- *  \param[in] cb Call-back function called when timerfd becomes readable
- *  \param[in] data Opaque data to be passed on to call-back
- *  \returns 0 on success; negative on error
- *
- *  We simply initialize the data structures here, but do not yet
- *  schedule the timer.
- */
-/* FIXME: Use libosmocore after release with 
Ibeffba7c997252c003723bcd5d14122c4ded2fe7 was made */
-static int timer_ofd_setup(struct osmo_fd *ofd, int (*cb)(struct osmo_fd *, 
unsigned int), void *data)
-{
-   ofd->cb = cb;
-   ofd->data = data;
-   ofd->when = BSC_FD_READ;
-
-   if (ofd->fd < 0) {
-   ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
-   if (ofd->fd < 0)
-   return ofd->fd;
-
-   osmo_fd_register(ofd);
-   }
-   return 0;
-}
-
 /*! Increment a GSM frame number modulo GSM_HYPERFRAME */
 #define INCREMENT_FN(fn)   (fn) = (((fn) + 1) % GSM_HYPERFRAME)
 
@@ -1557,7 +1495,7 @@
return 0;

 no_clock:
-   timer_ofd_disable(>fn_timer_ofd);
+   osmo_timerfd_disable(>fn_timer_ofd);
transceiver_available = 0;

bts_shutdown(bts, "No clock from osmo-trx");
@@ -1575,8 +1513,8 @@
trx_sched_fn(bts, tcs->last_fn_timer.fn);

/* schedule first FN clock timer */
-   timer_ofd_setup(>fn_timer_ofd, trx_fn_timer_cb, bts);
-   timer_ofd_schedule(>fn_timer_ofd, NULL, interval);
+   osmo_timerfd_setup(>fn_timer_ofd, trx_fn_timer_cb, bts);
+   osmo_timerfd_schedule(>fn_timer_ofd, NULL, interval);

tcs->last_fn_timer.tv = *tv_now;
tcs->last_clk_ind.tv = *tv_now;
@@ -1666,7 +1604,7 @@
normalize_timespec();
LOGP(DL1C, LOGL_NOTICE, "We were %d 

Change in osmo-msc[master]: gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11414


Change subject: gsm0407_is_duplicate(): Handle error ret of 
gsm0407_pdisc_ctr_bin()
..

gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()

Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4
Fixes: Coverity CID#182702
---
M src/libmsc/gsm_04_08.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/14/11414/1

diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 0f52d09..d5cc212 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1397,7 +1397,8 @@
 {
struct gsm48_hdr *gh;
uint8_t pdisc;
-   uint8_t n_sd, modulo, bin;
+   uint8_t n_sd, modulo;
+   int bin;

gh = msgb_l3(msg);
pdisc = gsm48_hdr_pdisc(gh);

--
To view, visit https://gerrit.osmocom.org/11414
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4
Gerrit-Change-Number: 11414
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: gsm23003: Add MME domain name related helper functions

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11411


Change subject: gsm23003: Add MME domain name related helper functions
..

gsm23003: Add MME domain name related helper functions

osmo_gen_mme_group_domain(), osmo_gen_mme_group_domain() and
osmo_gen_home_network_domain()

Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
---
M include/osmocom/gsm/gsm23003.h
M include/osmocom/gsm/protocol/gsm_23_003.h
M src/gsm/gsm23003.c
M src/gsm/libosmogsm.map
4 files changed, 61 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/11411/1

diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h
index fd4f369..0539fc7 100644
--- a/include/osmocom/gsm/gsm23003.h
+++ b/include/osmocom/gsm/gsm23003.h
@@ -120,3 +120,7 @@

 int osmo_mnc_cmp(uint16_t a_mnc, bool a_mnc_3_digits, uint16_t b_mnc, bool 
b_mnc_3_digits);
 int osmo_plmn_cmp(const struct osmo_plmn_id *a, const struct osmo_plmn_id *b);
+
+int osmo_gen_home_network_domain(char *out, uint16_t mcc, uint16_t mnc);
+int osmo_gen_mme_domain(char *out, uint8_t mmec, uint16_t mmegi, uint16_t mcc, 
uint16_t mnc);
+int osmo_gen_mme_group_domain(char *out, uint16_t mmegi, uint16_t mcc, 
uint16_t mnc);
diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h 
b/include/osmocom/gsm/protocol/gsm_23_003.h
index 0e66939..ee697ff 100644
--- a/include/osmocom/gsm/protocol/gsm_23_003.h
+++ b/include/osmocom/gsm/protocol/gsm_23_003.h
@@ -24,3 +24,9 @@
 GSM23003_IMEI_SNR_NUM_DIGITS + 1)
 #define GSM23003_IMEISV_NUM_DIGITS (GSM23003_IMEI_TAC_NUM_DIGITS + \
 GSM23003_IMEI_SNR_NUM_DIGITS + 2)
+
+/* Chapter 19.2 "epc.mnc000.mcc000.3gppnetwork.org" */
+#define GSM23003_HOME_NETWORK_DOMAIN_LEN   33
+
+/* Chapter 19.4.2.4: "mmec00.mmegi.mme.epc.mnc000.mcc000.3gppnetwork.org" 
*/
+#define GSM23003_MME_DOMAIN_LEN55
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 2c3b21e..bb73364 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -297,3 +297,51 @@
return 1;
return osmo_mnc_cmp(a->mnc, a->mnc_3_digits, b->mnc, b->mnc_3_digits);
 }
+
+/*! Generate TS 23.003 Section 19.2 Home Network Realm/Domain (text form)
+ *  \param out[out] caller-provided output buffer, at least 33 bytes long
+ *  \param mcc[in] Mobile Country Code
+ *  \param mnc[in] Mobile Network Code
+ *  \returns number of characters printed (excluding NUL); negative on error */
+int osmo_gen_home_network_domain(char *out, uint16_t mcc, uint16_t mnc)
+{
+   if (mcc > 999)
+   return -EINVAL;
+   if (mnc > 999)
+   return -EINVAL;
+   return sprintf(out, "epc.mnc%03u.mcc%03u.3gppnetwork.org", mcc, mnc);
+}
+
+/*! Generate TS 23.003 Section 19.4.2.4 MME Domain (text form)
+ *  \param out[out] caller-provided output buffer, at least 56 bytes long
+ *  \param mmec[in] MME Code
+ *  \param mmegi[in] MME Group Identifier
+ *  \param mcc[in] Mobile Country Code
+ *  \param mnc[in] Mobile Network Code
+ *  \returns number of characters printed (excluding NUL); negative on error */
+int osmo_gen_mme_domain(char *out, uint8_t mmec, uint16_t mmegi, uint16_t mcc, 
uint16_t mnc)
+{
+   char domain[GSM23003_HOME_NETWORK_DOMAIN_LEN+1];
+   int rc;
+   rc = osmo_gen_home_network_domain(domain, mcc, mnc);
+   if (rc < 0)
+   return rc;
+   return sprintf(out, "mmec%02x.mmegi%04x.mme.%s", mmec, mmegi, domain);
+}
+
+/*! Generate TS 23.003 Section 19.4.2.4 MME Group Domain (text form)
+ *  \param out[out] caller-provided output buffer, at least 56 bytes long
+ *  \param mmec[in] MME Code
+ *  \param mmegi[in] MME Group Identifier
+ *  \param mcc[in] Mobile Country Code
+ *  \param mnc[in] Mobile Network Code
+ *  \returns number of characters printed (excluding NUL); negative on error */
+int osmo_gen_mme_group_domain(char *out, uint16_t mmegi, uint16_t mcc, 
uint16_t mnc)
+{
+   char domain[GSM23003_HOME_NETWORK_DOMAIN_LEN+1];
+   int rc;
+   rc = osmo_gen_home_network_domain(domain, mcc, mnc);
+   if (rc < 0)
+   return rc;
+   return sprintf(out, "mmegi%04x.mme.%s", mmegi, domain);
+}
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index dcc491d..103334b 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -318,6 +318,9 @@
 osmo_mnc_from_str;
 osmo_mnc_cmp;
 osmo_plmn_cmp;
+osmo_gen_home_network_domain;
+osmo_gen_mme_domain;
+osmo_gen_mme_group_domain;
 gsm48_chan_mode_names;
 gsm_chan_t_names;
 gsm48_pdisc_names;

--
To view, visit https://gerrit.osmocom.org/11411
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb

Change in libosmocore[master]: timerfd_create(): Fix error handling of osmo_fd_register()

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11413


Change subject: timerfd_create(): Fix error handling of osmo_fd_register()
..

timerfd_create(): Fix error handling of osmo_fd_register()

Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Closes: Coverity CID#188853
---
M src/select.c
1 file changed, 7 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/11413/1

diff --git a/src/select.c b/src/select.c
index 0b115c6..b07ad8c 100644
--- a/src/select.c
+++ b/src/select.c
@@ -324,11 +324,17 @@
ofd->when = BSC_FD_READ;

if (ofd->fd < 0) {
+   int rc;
+
ofd->fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
if (ofd->fd < 0)
return ofd->fd;

-   osmo_fd_register(ofd);
+   rc = osmo_fd_register(ofd);
+   if (rc < 0) {
+   close(ofd->fd);
+   return rc;
+   }
}
return 0;
 }

--
To view, visit https://gerrit.osmocom.org/11413
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2528cc3e3155bbc9cb32dee0e3af99cc6e1c654
Gerrit-Change-Number: 11413
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: WIP: gsm_412 Cell Broadcast

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11410


Change subject: WIP: gsm_412 Cell Broadcast
..

WIP: gsm_412 Cell Broadcast

Change-Id: I1a17c2ae8bf62150327956c10cb5bb896939e3fd
---
M include/osmocom/gsm/protocol/gsm_04_12.h
1 file changed, 68 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/11410/1

diff --git a/include/osmocom/gsm/protocol/gsm_04_12.h 
b/include/osmocom/gsm/protocol/gsm_04_12.h
index 826e69b..749e3d7 100644
--- a/include/osmocom/gsm/protocol/gsm_04_12.h
+++ b/include/osmocom/gsm/protocol/gsm_04_12.h
@@ -30,3 +30,71 @@
uint8_t cbsms_msg_map[6];
uint8_t data[0];
 } __attribute__((packed));
+
+/* Section 9.3: ?? */
+
+/* 9.3.24: Warning Tyoe */
+#define GSM412_WARN_TYPE_EARTHQUAKE0x00
+#define GSM412_WARN_TYPE_TSUNAMI   0x01
+#define GSM412_WARN_TYPE_QUAKE_ANDTSUNAMI  0x02
+#define GSM412_WARN_TYPE_TEST  0x03
+#define GSM412_WARN_TYPE_OTHER 0x04
+struct gsm412_warning_type {
+   uint16_t warning_type:7,
+emerg_user_alert:1,
+popup:1,
+padding:7;
+} __attribute__((packed));
+
+
+/* 9.3.25 */
+struct gsm412_warning_sec_info {
+   uint8_t year;
+   uint8_t month;
+   uint8_t day;
+   uint8_t hour;
+   uint8_t minute;
+   uint8_t second;
+   uint8_t timezone;
+   uint8_t signature[43];
+} __attribute__((packed));
+
+/* Section 9.4: Message Format on the Radio Network - MS/UE Interface */
+
+/* 9.4.1.2.1 Serial Number */
+#define GSM412_SERNR_GS_CELL_IMM   0
+#define GSM412_SERNR_GS_PLMN_NORM  1
+#define GSM412_SERNR_GS_LA_SA_TA_NORM  2
+#define GSM412_SERNR_GS_CELL_NORM  3
+
+struct gsm412_9_serial_nr {
+   uint16_tgs:2,
+   msg_code:10,
+   update_nr: 4;
+} __attribute__((packed));
+
+/* 9.4.1.2.4 Page Parameter */
+struct gsm412_9_page_param {
+   uint8_t total_pages:4,
+   page_nr:4;
+} __attribute__((packed));
+
+/* 9.4.1.2 Message Parameter */
+struct gsm412_9_message {
+   struct gsm412_9_serial_nr   ser_nr; /* 9.4.1.2.1 */
+   uint16_tmsg_id; /* 9.4.1.2.2 */
+   uint8_t dcs;/* TS 23.038 */
+   struct gsm412_9_page_param  page_param; /* 9.4.1.2.4 */
+   uint8_t content[0]; /* byte 7..88, i.e. 
0-82 octets */
+} __attribute__((packed));
+
+/* 9.4.1.3 ETWS Primary Notification Message */
+struct gsm412_9_etws_prim_notif_msg {
+   struct gsm412_9_serial_nr   ser_nr; /* 9.4.1.2.1 */
+   uint16_tmsg_id; /* 9.4.1.2.2 */
+   struct gsm412_warning_type  warning_type;   /* 9.3.24 */
+   uint8_t warning_sec_info[50]; /* 9.3.25 */
+} __attribute__((packed));
+
+
+//struct gsm412_

--
To view, visit https://gerrit.osmocom.org/11410
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a17c2ae8bf62150327956c10cb5bb896939e3fd
Gerrit-Change-Number: 11410
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: SGsAP protocol definitions (header + C file)

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11412


Change subject: SGsAP protocol definitions (header + C file)
..

SGsAP protocol definitions (header + C file)

Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
---
M include/Makefile.am
A include/osmocom/gsm/protocol/gsm_29_118.h
M src/gsm/Makefile.am
A src/gsm/gsm29118.c
M src/gsm/libosmogsm.map
5 files changed, 304 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/11412/1

diff --git a/include/Makefile.am b/include/Makefile.am
index 19695d1..59a5fed 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -114,6 +114,7 @@
osmocom/gsm/protocol/gsm_09_02.h \
osmocom/gsm/protocol/gsm_12_21.h \
   osmocom/gsm/protocol/gsm_23_003.h \
+  osmocom/gsm/protocol/gsm_29_118.h \
osmocom/gsm/protocol/gsm_44_318.h \
osmocom/gsm/protocol/ipaccess.h \
osmocom/gsm/protocol/smpp34_osmocom.h \
diff --git a/include/osmocom/gsm/protocol/gsm_29_118.h 
b/include/osmocom/gsm/protocol/gsm_29_118.h
new file mode 100644
index 000..24e9de2
--- /dev/null
+++ b/include/osmocom/gsm/protocol/gsm_29_118.h
@@ -0,0 +1,169 @@
+#pragma once
+
+
+/* TS 29.118 Section 9.2 */
+enum sgsap_msg_type {
+   /* unassigned */
+   SGSAP_MSGT_PAGING_REQ   = 0x01,
+   SGSAP_MSGT_PAGING_REJ   = 0x02,
+   /* unassigned */
+   SGSAP_MSGT_SERVICE_REQ  = 0x06,
+   SGSAP_MSGT_DL_UD= 0x07,
+   SGSAP_MSGT_UL_UD= 0x08,
+   SGSAP_MSGT_LOC_UPD_REQ  = 0x09,
+   SGSAP_MSGT_LOC_UPD_ACK  = 0x0a,
+   SGSAP_MSGT_LOC_UPD_REJ  = 0x0b,
+   SGSAP_MSGT_TMSI_REALL_CMPL  = 0x0c,
+   SGSAP_MSGT_ALERT_REQ= 0x0d,
+   SGSAP_MSGT_ALERT_ACK= 0x0e,
+   SGSAP_MSGT_ALERT_REJ= 0x0f,
+   SGSAP_MSGT_UE_ACT_IND   = 0x10,
+   SGSAP_MSGT_EPS_DET_IND  = 0x11,
+   SGSAP_MSGT_EPS_DET_ACK  = 0x12,
+   SGSAP_MSGT_IMSI_DET_IND = 0x13,
+   SGSAP_MSGT_IMSI_DET_ACK = 0x14,
+   SGSAP_MSGT_RESET_IND= 0x15,
+   SGSAP_MSGT_RESET_ACK= 0x16,
+   SGSAP_MSGT_SERVICE_ABORT_REQ= 0x17,
+   SGSAP_MSGT_MO_CSFB_IND  = 0x18,
+   /* unassigned */
+   SGSAP_MSGT_MM_INFO_REQ  = 0x1a,
+   SGSAP_MSGT_RELEASE_REQ  = 0x1b,
+   /* unassigned */
+   SGSAP_MSGT_STATUS   = 0x1d,
+   /* unassigned */
+   SGSAP_MSGT_UE_UNREACHABLE   = 0x1f,
+};
+const struct value_string sgsap_msg_type_names[];
+static inline const char *sgsap_msg_type_name(enum sgsap_msg_type msgt) {
+   return get_value_string(sgsap_msg_type_names, msgt);
+}
+
+/* TS 29.118 Section 9.3 */
+enum sgsap_iei {
+   SGSAP_IE_IMSI   = 0x01,
+   SGSAP_IE_VLR_NAME   = 0x02,
+   SGSAP_IE_TMSI   = 0x03,
+   SGSAP_IE_LAI= 0x04,
+   SGSAP_IE_CHAN_NEEDED= 0x05,
+   SGSAP_IE_EMLPP_PRIORITY = 0x06,
+   SGSAP_IE_TMSI_STATUS= 0x07,
+   SGSAP_IE_SGS_CAUSE  = 0x08,
+   SGSAP_IE_MME_NAME   = 0x09,
+   SGSAP_IE_EPS_LU_TYPE= 0x0a,
+   SGSAP_IE_GLOBAL_CN_ID   = 0x0b,
+   SGSAP_IE_MOBILE_ID  = 0x0e,
+   SGSAP_IE_REJECT_CAUSE   = 0x0f,
+   SGSAP_IE_IMSI_DET_EPS_TYPE  = 0x10,
+   SGSAP_IE_IMSI_DET_NONEPS_TYPE   = 0x11,
+   SGSAP_IE_IMEISV = 0x15,
+   SGSAP_IE_NAS_MSG_CONTAINER  = 0x16,
+   SGSAP_IE_MM_INFO= 0x17,
+   SGSAP_IE_ERR_MSG= 0x1b,
+   SGSAP_IE_CLI= 0x1c,
+   SGSAP_IE_LCS_CLIENT_ID  = 0x1d,
+   SGSAP_IE_LCS_INDICATOR  = 0x1e,
+   SGSAP_IE_SS_CODE= 0x1f,
+   SGSAP_IE_SERVICE_INDICATOR  = 0x20,
+   SGSAP_IE_UE_TIMEZONE= 0x21,
+   SGSAP_IE_MS_CLASSMARK2  = 0x22,
+   SGSAP_IE_TAI= 0x23,
+   SGSAP_IE_EUTRAN_CGI = 0x24,
+   SGSAP_IE_UE_EMM_MODE= 0x25,
+   SGSAP_IE_ADDL_PAGING_INDICATORS = 0x26,
+   SGSAP_IE_TMSI_BASED_NRI_CONT= 0x27,
+};
+
+
+/* TS 29.118 Section 9.4.2 

Change in osmo-bsc[master]: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11409


Change subject: subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from 
unknown MSC
..

subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC

Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Fixes: Coverity CID#188860
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/11409/1

diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c 
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 52afd54..bca9e1f 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -276,8 +276,9 @@
if (!conn->sccp.msc) {
LOGPFSML(fi, LOGL_NOTICE, "N-CONNECT.ind from unknown 
MSC %s\n",
 
osmo_sccp_addr_dump(_prim->u.connect.calling_addr));
-   osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user, 
scu_prim->u.connect.conn_id,
-_prim->u.connect.called_addr, 
0);
+   /* We cannot find a way to the sccp_user without the 
MSC, so we cannot
+* use osmo_sccp_tx_disconn() :( */
+   //osmo_sccp_tx_disconn(conn->sccp.msc->a.sccp_user, 
scu_prim->u.connect.conn_id, _prim->u.connect.called_addr, 0);
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL);
return;
}

--
To view, visit https://gerrit.osmocom.org/11409
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Gerrit-Change-Number: 11409
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-bsc[master]: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11407


Change subject: ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing
..

ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing

Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Fixes: Coverity CID#188867
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/11407/1

diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index a2ce633..26c5bcd 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -458,7 +458,11 @@
case IPAC_MSGT_ID_RESP:
DEBUGP(DLMI, "ID_RESP ");
/* parse tags, search for Unit ID */
-   ipa_ccm_id_resp_parse(, (uint8_t *)msg->l2h+1, 
msgb_l2len(msg)-1);
+   ret = ipa_ccm_id_resp_parse(, (uint8_t *)msg->l2h+1, 
msgb_l2len(msg)-1);
+   if (ret < 0) {
+   LOGP(DLINP, LOGL_ERROR, "Error parsing CCM ID RESP 
!?!\n");
+   return -EIO;
+   }
DEBUGP(DLMI, "\n");

if (!TLVP_PRESENT(, IPAC_IDTAG_UNIT)) {

--
To view, visit https://gerrit.osmocom.org/11407
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Gerrit-Change-Number: 11407
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-bsc[master]: acc_ramp: An unsigned int is always >= 0

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11408


Change subject: acc_ramp: An unsigned int is always >= 0
..

acc_ramp: An unsigned int is always >= 0

Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
---
M src/osmo-bsc/acc_ramp.c
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/11408/1

diff --git a/src/osmo-bsc/acc_ramp.c b/src/osmo-bsc/acc_ramp.c
index ac9f02d..bc2e3fb 100644
--- a/src/osmo-bsc/acc_ramp.c
+++ b/src/osmo-bsc/acc_ramp.c
@@ -36,7 +36,7 @@
  */
 static bool acc_is_permanently_barred(struct gsm_bts *bts, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc == 8 || acc == 9)
return (bts->si_common.rach_control.t2 & (1 << (acc - 8)));
return (bts->si_common.rach_control.t3 & (1 << (acc)));
@@ -44,7 +44,7 @@

 static void allow_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if (acc_ramp->barred_accs & (1 << acc))
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: allowing Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs &= ~(1 << acc);
@@ -52,7 +52,7 @@

 static void barr_one_acc(struct acc_ramp *acc_ramp, unsigned int acc)
 {
-   OSMO_ASSERT(acc >= 0 && acc <= 9);
+   OSMO_ASSERT(acc <= 9);
if ((acc_ramp->barred_accs & (1 << acc)) == 0)
LOGP(DRSL, LOGL_NOTICE, "(bts=%d) ACC RAMP: barring Access 
Control Class %u\n", acc_ramp->bts->nr, acc);
acc_ramp->barred_accs |= (1 << acc);

--
To view, visit https://gerrit.osmocom.org/11408
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Gerrit-Change-Number: 11408
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-trx[master]: SocketsTest.testReaderIP(): Zero terminate received buffer

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11405


Change subject: SocketsTest.testReaderIP(): Zero terminate received buffer
..

SocketsTest.testReaderIP(): Zero terminate received buffer

Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
---
M tests/CommonLibs/SocketsTest.cpp
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/05/11405/1

diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index eb92e25..e4eef54 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -47,9 +47,10 @@
readSocket->nonblocking();
int rc = 0;
while (rcread(buf, MAX_UDP_LENGTH);
if (count>0) {
+   buf[count] = 0;
CERR("read: " << buf);
rc++;
} else {

--
To view, visit https://gerrit.osmocom.org/11405
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd144e672ab15cfb0955897dd6eb529c56908eba
Gerrit-Change-Number: 11405
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-trx[master]: trx_validate_config(): Fix validation of rx_sps

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11406


Change subject: trx_validate_config(): Fix validation of rx_sps
..

trx_validate_config(): Fix validation of rx_sps

Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Fixes: Coverity CID#188871
---
M CommonLibs/Logger.cpp
M Transceiver52M/osmo-trx.cpp
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/06/11406/1

diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp
index 171c635..cdf0544 100644
--- a/CommonLibs/Logger.cpp
+++ b/CommonLibs/Logger.cpp
@@ -52,7 +52,7 @@
ScopedLock lock(gLogToLock);
// The COUT() macro prevents messages from stomping each other but adds 
uninteresting thread numbers,
// so just use std::cout.
-   LOGPSRC(mCategory, mPriority, filename, line, fmt, 
mStream.str().c_str());
+   //LOGPSRC(mCategory, mPriority, filename, line, fmt, 
mStream.str().c_str());
pthread_setcancelstate(old_state, NULL);
 }

diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp
index d01a4cf..7f72c47 100644
--- a/Transceiver52M/osmo-trx.cpp
+++ b/Transceiver52M/osmo-trx.cpp
@@ -376,7 +376,7 @@

/* Force 4 SPS for EDGE or multi-ARFCN configurations */
if ((trx->cfg.egprs || trx->cfg.multi_arfcn) &&
-   (trx->cfg.tx_sps!=4 || trx->cfg.tx_sps!=4)) {
+   (trx->cfg.tx_sps!=4 || trx->cfg.rx_sps!=4)) {
LOG(ERROR) << "EDGE and Multi-Carrier options require 4 tx and 
rx sps. Check you config.";
return -1;
}

--
To view, visit https://gerrit.osmocom.org/11406
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e932cff59335add09c76caba6f9ac1e7cf69022
Gerrit-Change-Number: 11406
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-ggsn[master]: sgsnemu: Use in46a_from_eua() with array of in46_addr

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11404


Change subject: sgsnemu: Use in46a_from_eua() with array of in46_addr
..

sgsnemu: Use in46a_from_eua() with array of in46_addr

Change-Id: Ie5a572a507d0556736a661cd3c1216e1e2a2a5df
Fixes: Coverity CID#180704
---
M sgsnemu/sgsnemu.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/04/11404/1

diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 1e61a09..9be8335 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -1373,7 +1373,7 @@

 static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
 {
-   struct in46_addr addr;
+   struct in46_addr addr[2];

struct iphash_t *iph = (struct iphash_t *)cbp;


--
To view, visit https://gerrit.osmocom.org/11404
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5a572a507d0556736a661cd3c1216e1e2a2a5df
Gerrit-Change-Number: 11404
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-mgw[master]: check_rtp_origin(): Avoid using memcmp for comparing integer types

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11403


Change subject: check_rtp_origin(): Avoid using memcmp for comparing integer 
types
..

check_rtp_origin(): Avoid using memcmp for comparing integer types

in_addr consists only of s_addr, which is an integer type that
can be compared directly.  By avoiding memcmp() here we would have
been able to catch Coverity CID#188874 even without Coverity, and
make the code more compact...

Change-Id: Ic6105d39ae2fb4b301f87448b16763fe9f695621
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 2 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/03/11403/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index fe63f1e..de34cc6 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -872,9 +872,8 @@
 {
struct mgcp_endpoint *endp;
endp = conn->conn->endp;
-   struct sockaddr_in zero_addr = {};

-   if (memcmp(_addr.sin_addr, >end.addr, 
sizeof(zero_addr.sin_addr)) == 0) {
+   if (conn->end.addr.s_addr == 0) {
switch (conn->conn->mode) {
case MGCP_CONN_LOOPBACK:
/* HACK: for IuUP, we want to reply with an IuUP 
Initialization ACK upon the first RTP
@@ -904,8 +903,7 @@

/* Note: Check if the inbound RTP data comes from the same host to
 * which we send our outgoing RTP traffic. */
-   if (memcmp(>sin_addr, >end.addr, sizeof(addr->sin_addr))
-   != 0) {
+   if (conn->end.addr.s_addr != addr->sin_addr.s_addr) {
LOGP(DRTP, LOGL_ERROR,
 "endpoint:0x%x data from wrong address: %s, ",
 ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr));

--
To view, visit https://gerrit.osmocom.org/11403
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6105d39ae2fb4b301f87448b16763fe9f695621
Gerrit-Change-Number: 11403
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-mgw[master]: check_rtp_origin(): Don't memcmp sockadd_in and in_addr

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11402


Change subject: check_rtp_origin(): Don't memcmp sockadd_in and in_addr
..

check_rtp_origin(): Don't memcmp sockadd_in and in_addr

We were comparing 16 bytes (sockaddr_in) in memcmp() rather than using
four bytes (struct in_addr in mgcp conn end).

This is a good example why we should actually simply use the == (equals)
operator rather than using memcmp which treats everything as void.

Change-Id: Ic64256619ef893d625400e8b1b573ea2c629ed9c
Fixes: Coverity CID#188874
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/02/11402/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index d769ef3..fe63f1e 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -874,7 +874,7 @@
endp = conn->conn->endp;
struct sockaddr_in zero_addr = {};

-   if (memcmp(_addr, >end.addr, sizeof(zero_addr)) == 0) {
+   if (memcmp(_addr.sin_addr, >end.addr, 
sizeof(zero_addr.sin_addr)) == 0) {
switch (conn->conn->mode) {
case MGCP_CONN_LOOPBACK:
/* HACK: for IuUP, we want to reply with an IuUP 
Initialization ACK upon the first RTP

--
To view, visit https://gerrit.osmocom.org/11402
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic64256619ef893d625400e8b1b573ea2c629ed9c
Gerrit-Change-Number: 11402
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-pcu[master]: gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tv

2018-10-21 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/11401


Change subject: gprs_rlcmac_received_lost(): Fix regression / uninitialized 
now_tv
..

gprs_rlcmac_received_lost(): Fix regression / uninitialized now_tv

In Change-Id I7d22e7b5902c230efeae66eb20c17026a4037887 we
introduced the use of timespecsub(). Unfortuantely, we also
accidentially removed the call to osmo_clock_gettime() along
with it, leaving now_tv completely uninitialized.

Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Related: OS#3225
Fixes: Coverity CID#188872
---
M src/gprs_rlcmac_meas.cpp
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/01/11401/1

diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp
index f6448d5..9ff06db 100644
--- a/src/gprs_rlcmac_meas.cpp
+++ b/src/gprs_rlcmac_meas.cpp
@@ -131,6 +131,7 @@
tbf->m_bw.dl_loss_received += received;
tbf->m_bw.dl_loss_lost += lost;

+   osmo_clock_gettime(CLOCK_MONOTONIC, _tv);
timespecsub(_tv, loss_tv, );
if (elapsed.tv_sec < 1)
return 0;

--
To view, visit https://gerrit.osmocom.org/11401
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieced0c62700b2fe4ab0208258183154cc701490b
Gerrit-Change-Number: 11401
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


  1   2   >