libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function

2017-08-10 Thread Holger Freyther

Patch Set 1:

Could you put a backtrace into the commit message?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] openbsc[master]: libmsc: Remove comment not applying anymore

2017-08-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libmsc: Remove comment not applying anymore
..


libmsc: Remove comment not applying anymore

The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to
the databse but forgot to remove the comment stating it's not being
stored.

Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3
---
M openbsc/src/libmsc/db.c
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 9945dca..631e05f 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -1649,7 +1649,6 @@
sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id");
sms->data_coding_scheme = dbi_result_get_ulonglong(result,
  "data_coding_scheme");
-   /* sms->msg_ref is temporary and not stored in DB */
 
sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi");
sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton");

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 


[MERGED] openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value

2017-08-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libmsc: gsm340_gen_oa_sub() may return negative value
..


libmsc: gsm340_gen_oa_sub() may return negative value

gsm340_gen_oa() returns a negative value if the output buffer that the
caller passes is too small, so we have to check the return value of this
function.

Fixes: CID 174178
Fixes: CID 174179
Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb
---
M openbsc/src/libmsc/gsm_04_11.c
1 file changed, 9 insertions(+), 2 deletions(-)

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



diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 73e0f55..8b4ffce 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -213,9 +213,9 @@
 {
uint8_t *smsp;
uint8_t oa[12]; /* max len per 03.40 */
-   uint8_t oa_len = 0;
uint8_t octet_len;
unsigned int old_msg_len = msg->len;
+   int oa_len;
 
/* generate first octet with masked bits */
smsp = msgb_put(msg, 1);
@@ -233,6 +233,9 @@
 
/* generate originator address */
oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), >src);
+   if (oa_len < 0)
+   return -ENOSPC;
+
smsp = msgb_put(msg, oa_len);
memcpy(smsp, oa, oa_len);
 
@@ -282,9 +285,9 @@
 struct gsm_sms *sms)
 {
unsigned int old_msg_len = msg->len;
-   uint8_t oa_len = 0;
uint8_t oa[12]; /* max len per 03.40 */
uint8_t *smsp;
+   int oa_len;
 
/* generate first octet with masked bits */
smsp = msgb_put(msg, 1);
@@ -296,8 +299,12 @@
/* TP-MR (message reference) */
smsp = msgb_put(msg, 1);
*smsp = sms->msg_ref;
+
/* generate recipient address */
oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), >dst);
+   if (oa_len < 0)
+   return -ENOSPC;
+
smsp = msgb_put(msg, oa_len);
memcpy(smsp, oa, oa_len);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openbsc[master]: libmsc: Remove comment not applying anymore

2017-08-10 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value

2017-08-10 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openbsc[master]: handover_logic: set correct link to bts for subscriber_conne...

2017-08-10 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function

2017-08-10 Thread Harald Welte

Patch Set 1:

could we have a unit test case to avoid regressions here? Also, is this an 
overlap with gerrit 266 or 3257?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-msc[master]: log protocol discriminators and message types by name

2017-08-10 Thread Neels Hofmeyr

Patch Set 5:

(1 comment)

https://gerrit.osmocom.org/#/c/3350/5/tests/msc_vlr/msc_vlr_tests.c
File tests/msc_vlr/msc_vlr_tests.c:

Line 168:   log("MSC <--%s-- MS: %s",
> unrelated to the current patch: In general, we have shown the MS always on 
agreed, no idea why I got the direction wrong this time


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d
Gerrit-PatchSet: 5
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client()

2017-08-10 Thread Neels Hofmeyr

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: neels 
Gerrit-HasComments: No


[PATCH] libosmo-sccp[master]: vty: command to set local ip of ASP

2017-08-10 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/3271

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

vty: command to set local ip of ASP

The local ip of an ASP can not be set, while the same is possible
for the remote ip.

Add VTY command to set the local ip of an ASP

Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a
---
M src/osmo_ss7_vty.c
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/71/3271/3

diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 9343edd..ca77bf6 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -565,6 +565,16 @@
return CMD_SUCCESS;
 }
 
+DEFUN(asp_local_ip, asp_local_ip_cmd,
+   "local-ip A.B.C.D",
+   "Specify Local IP Address of ASP\n"
+   "Local IP Address of ASP\n")
+{
+   struct osmo_ss7_asp *asp = vty->index;
+   osmo_talloc_replace_string(asp, >cfg.local.host, argv[0]);
+   return CMD_SUCCESS;
+}
+
 DEFUN(asp_qos_clas, asp_qos_class_cmd,
"qos-class <0-255>",
"Specify QoS Class of ASP\n"
@@ -633,6 +643,10 @@
if (asp->cfg.description)
vty_out(vty, "  description %s%s", asp->cfg.description, 
VTY_NEWLINE);
vty_out(vty, "  remote-ip %s%s", asp->cfg.remote.host, VTY_NEWLINE);
+
+   if (cs7_role == CS7_ROLE_ASP)
+   vty_out(vty, "  local-ipy %s%s", asp->cfg.local.host, 
VTY_NEWLINE);
+
if (asp->cfg.qos_class)
vty_out(vty, "  qos-class %u%s", asp->cfg.qos_class, 
VTY_NEWLINE);
 }
@@ -1725,6 +1739,8 @@
 {
cs7_role = CS7_ROLE_ASP;
vty_init_shared(ctx);
+
+   install_element(L_CS7_ASP_NODE, _local_ip_cmd);
 }
 
 void osmo_ss7_vty_init_sg(void *ctx)

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I115b87b08bdc4b07772b7afb9c25bc713e79945a
Gerrit-PatchSet: 3
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


[PATCH] libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client()

2017-08-10 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/3468

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

sccp: prefix default parameters of osmo_sccp_simple_client()

The simple client takes certain parameters (pc, ip and port
numbers) which serve as a fallback default in case the user
did not configure any suitable parameters via the VTY.

Prefix all default variables with default_ to make the
purpose clear to the API user

Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63
---
M include/osmocom/sigtran/osmo_ss7.h
M src/sccp_user.c
2 files changed, 37 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/68/3468/2

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index a457709..71c2022 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -445,17 +445,20 @@
 
 void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs);
 
-
 struct osmo_sccp_instance *
-osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc,
-   enum osmo_ss7_asp_protocol prot, int local_port,
-   const char *local_ip, int remote_port, const char 
*remote_ip);
+osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
+   enum osmo_ss7_asp_protocol prot, int default_local_port,
+   const char *default_local_ip, int default_remote_port,
+   const char *default_remote_ip);
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
- uint32_t pc, enum osmo_ss7_asp_protocol prot,
- int local_port, const char *local_ip,
- int remote_port, const char *remote_ip);
+ uint32_t default_pc,
+ enum osmo_ss7_asp_protocol prot,
+ int default_local_port,
+ const char *default_local_ip,
+ int default_remote_port,
+ const char *default_remote_ip);
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_server(void *ctx, uint32_t pc,
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 1d59d3c..9116b60 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -297,9 +297,12 @@
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
- uint32_t pc, enum osmo_ss7_asp_protocol prot,
- int local_port, const char *local_ip,
- int remote_port, const char *remote_ip)
+ uint32_t default_pc,
+ enum osmo_ss7_asp_protocol prot,
+ int default_local_port,
+ const char *default_local_ip,
+ int default_remote_port,
+ const char *default_remote_ip)
 {
struct osmo_ss7_instance *ss7;
bool ss7_created = false;
@@ -313,10 +316,10 @@
 
/* Choose default ports when the caller does not supply valid port
 * numbers. */
-   if (!remote_port || remote_port < 0)
-   remote_port = osmo_ss7_asp_protocol_port(prot);
-   if (local_port < 0)
-   local_port = osmo_ss7_asp_protocol_port(prot);
+   if (!default_remote_port || default_remote_port < 0)
+   default_remote_port = osmo_ss7_asp_protocol_port(prot);
+   if (default_local_port < 0)
+   default_local_port = osmo_ss7_asp_protocol_port(prot);
 
/* Check if there is already an ss7 instance present under
 * the given id. If not, we will create a new one. */
@@ -336,7 +339,7 @@
/* Setup primary pointcode
 * NOTE: This means that the user must set the pointcode to a
 * proper value when a cs7 instance is defined via the VTY. */
-   ss7->cfg.primary_pc = pc;
+   ss7->cfg.primary_pc = default_pc;
ss7_created = true;
}
LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name,
@@ -393,17 +396,18 @@
 name);
asp_name = talloc_asprintf(ctx, "asp-clnt-%s", name);
asp =
-   osmo_ss7_asp_find_or_create(ss7, asp_name, remote_port,
-   local_port, prot);
+   osmo_ss7_asp_find_or_create(ss7, asp_name,
+   default_remote_port,
+   default_local_port, prot);
talloc_free(asp_name);
if (!asp)
goto out_rt;
   

[PATCH] libosmo-sccp[master]: sccp: prefix default parameters of osmo_sccp_simple_client()

2017-08-10 Thread dexter

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

sccp: prefix default parameters of osmo_sccp_simple_client()

The simple client takes certain parameters (pc, ip and port
numbers) which serve as a fallback default in case the user
did not configure any suitable parameters via the VTY.

Prefix all default variables with default_ to make the
purpose clear to the API user

Change-Id: Id9e697e8b198e4f58a79e59aaf2e649e84a3eb63
---
M include/osmocom/sigtran/osmo_ss7.h
M src/sccp_user.c
2 files changed, 42 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/68/3468/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index a457709..71c2022 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -445,17 +445,20 @@
 
 void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs);
 
-
 struct osmo_sccp_instance *
-osmo_sccp_simple_client(void *ctx, const char *name, uint32_t pc,
-   enum osmo_ss7_asp_protocol prot, int local_port,
-   const char *local_ip, int remote_port, const char 
*remote_ip);
+osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
+   enum osmo_ss7_asp_protocol prot, int default_local_port,
+   const char *default_local_ip, int default_remote_port,
+   const char *default_remote_ip);
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
- uint32_t pc, enum osmo_ss7_asp_protocol prot,
- int local_port, const char *local_ip,
- int remote_port, const char *remote_ip);
+ uint32_t default_pc,
+ enum osmo_ss7_asp_protocol prot,
+ int default_local_port,
+ const char *default_local_ip,
+ int default_remote_port,
+ const char *default_remote_ip);
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_server(void *ctx, uint32_t pc,
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 1d59d3c..41f9587 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -297,9 +297,12 @@
 
 struct osmo_sccp_instance *
 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
- uint32_t pc, enum osmo_ss7_asp_protocol prot,
- int local_port, const char *local_ip,
- int remote_port, const char *remote_ip)
+ uint32_t default_pc,
+ enum osmo_ss7_asp_protocol prot,
+ int default_local_port,
+ const char *default_local_ip,
+ int default_remote_port,
+ const char *default_remote_ip)
 {
struct osmo_ss7_instance *ss7;
bool ss7_created = false;
@@ -313,17 +316,16 @@
 
/* Choose default ports when the caller does not supply valid port
 * numbers. */
-   if (!remote_port || remote_port < 0)
-   remote_port = osmo_ss7_asp_protocol_port(prot);
-   if (local_port < 0)
-   local_port = osmo_ss7_asp_protocol_port(prot);
+   if (!default_remote_port || default_remote_port < 0)
+   default_remote_port = osmo_ss7_asp_protocol_port(prot);
+   if (default_local_port < 0)
+   default_local_port = osmo_ss7_asp_protocol_port(prot);
 
/* Check if there is already an ss7 instance present under
 * the given id. If not, we will create a new one. */
ss7 = osmo_ss7_instance_find(ss7_id);
if (!ss7) {
-   LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n",
-name);
+   LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating SS7 instance\n", name);
 
/* Create a new ss7 instance */
ss7 = osmo_ss7_instance_find_or_create(ctx, ss7_id);
@@ -336,7 +338,7 @@
/* Setup primary pointcode
 * NOTE: This means that the user must set the pointcode to a
 * proper value when a cs7 instance is defined via the VTY. */
-   ss7->cfg.primary_pc = pc;
+   ss7->cfg.primary_pc = default_pc;
ss7_created = true;
}
LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name,
@@ -353,8 +355,7 @@
 * the protocol we intend to use. If not, we will create one. */
as = osmo_ss7_as_find_by_proto(ss7, prot);
if (!as) {
-   LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n",
-name);
+   LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating AS instance\n", name);

[PATCH] libosmocore[master]: lapd_core: Fix crash in lapd_est_req() function

2017-08-10 Thread Ivan Kluchnikov

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

lapd_core: Fix crash in lapd_est_req() function

lapd_est_req() function could be called on uninitialized lapd link
(before lapd_dl_init() and after lapd_dl_exit() functions) due to
invalid usage on higher levels.
In order to prevent using uninitialized lapd link, we should set
LAPD_STATE_NULL state for lapd_datalink in lapd_dl_exit() function.
So all messages for lapd_datalink in null state will be unhandled by
lapd_recv_dlsap() function and lapd_est_req() function will not be
called before lapd_dl_init() function where lapd link state is changed
to idle.

Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c
Related: OS#1982
---
M src/gsm/lapd_core.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/3467/1

diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index 166bf9a..6b58006 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -326,6 +326,10 @@
 {
/* free all ressources except history buffer */
lapd_dl_reset(dl);
+
+   /* enter null state */
+   lapd_dl_newstate(dl, LAPD_STATE_NULL);
+
/* free history buffer list */
talloc_free(dl->tx_hist);
dl->tx_hist = NULL;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I306dad9b78e3becaef14c5305ec25c312feefe3c
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov 


[PATCH] openbsc[master]: handover_logic: set correct link to bts for subscriber_conne...

2017-08-10 Thread Ivan Kluchnikov

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

handover_logic: set correct link to bts for subscriber_connection in case of 
moving this connection to another bts

In case of successful completion of handover gsm_subscriber_connection could be 
moved from one bts to another,
so connection link to bts should be replaced by link to bts, which owns 
new_lchan.
This bug was detected, because conn->bts->nr is used in call control log 
messages
and wrong number of bts was observed in these messages after handover.

Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9
---
M openbsc/src/libbsc/handover_logic.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/3466/1

diff --git a/openbsc/src/libbsc/handover_logic.c 
b/openbsc/src/libbsc/handover_logic.c
index 4dd913b..795a2ee 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -281,6 +281,7 @@
 
new_lchan->conn->ho_lchan = NULL;
new_lchan->conn->lchan = new_lchan;
+   new_lchan->conn->bts = new_lchan->ts->trx->bts;
ho->old_lchan->conn = NULL;
 
lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Ivan Kluchnikov 


openbsc[master]: libmsc: update database to accomodate SMS status-report fields

2017-08-10 Thread Holger Freyther

Patch Set 4:

> > Can it work here?
 > I don't believe so, SQLITE3 ALTER TABLE is limited to adding new
 > columns to the end of the table. Probably why it's done like this
 > in previous db version upgrades.
 > https://www.sqlite.org/lang_altertable.html

IIRC in the past we wanted to change the type of a column. Here we would not 
have cared where the new column gets added.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] openbsc[master]: libmsc: Remove comment not applying anymore

2017-08-10 Thread Pau Espin Pedrol

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

libmsc: Remove comment not applying anymore

The change-id I7276d356d805a83ebeec72b02c8563b7135ea0b6 added msg_ref to
the databse but forgot to remove the comment stating it's not being
stored.

Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3
---
M openbsc/src/libmsc/db.c
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/3465/1

diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c
index 9945dca..631e05f 100644
--- a/openbsc/src/libmsc/db.c
+++ b/openbsc/src/libmsc/db.c
@@ -1649,7 +1649,6 @@
sms->protocol_id = dbi_result_get_ulonglong(result, "protocol_id");
sms->data_coding_scheme = dbi_result_get_ulonglong(result,
  "data_coding_scheme");
-   /* sms->msg_ref is temporary and not stored in DB */
 
sms->dst.npi = dbi_result_get_ulonglong(result, "dest_npi");
sms->dst.ton = dbi_result_get_ulonglong(result, "dest_ton");

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I204f098c8f2a480405446113e2181b2c53700cf3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present

2017-08-10 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

Tested on the main unit. Pcap files still contain the whole information and 
this way we don't record unrelated stuff.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present

2017-08-10 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: util: ip_to_iface: Return secondary iface if present
..


util: ip_to_iface: Return secondary iface if present

In the following example setup, if osmo-nitb is listening
on 10.42.42.2, we want to return eth1:0 instead of eth1.

ip addr show eth1
3: eth1:  mtu 1500 qdisc pfifo_fast state UP 
group default qlen 1000
link/ether 00:0d:b9:35:3a:41 brd ff:ff:ff:ff:ff:ff
inet 10.42.42.1/24 brd 10.42.42.255 scope global eth1
   valid_lft forever preferred_lft forever
inet 10.42.42.2/24 brd 10.42.42.255 scope global secondary eth1:0
   valid_lft forever preferred_lft forever
inet 10.42.42.3/24 brd 10.42.42.255 scope global secondary eth1:1
   valid_lft forever preferred_lft forever

Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
---
M src/osmo_gsm_tester/util.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 266243c..602ae45 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -44,7 +44,7 @@
 proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], 
stdout=subprocess.PIPE, universal_newlines=True)
 for line in proc.stdout.readlines():
 if 'inet' in line and ' ' + ip + '/' in line:
-return iface
+return line.split()[-1]
 except Exception as e:
 pass
 return None

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: util: ip_to_iface: Return secondary iface if present

2017-08-10 Thread Pau Espin Pedrol

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

util: ip_to_iface: Return secondary iface if present

In the following example setup, if osmo-nitb is listening
on 10.42.42.2, we want to return eth1:0 instead of eth1.

ip addr show eth1
3: eth1:  mtu 1500 qdisc pfifo_fast state UP 
group default qlen 1000
link/ether 00:0d:b9:35:3a:41 brd ff:ff:ff:ff:ff:ff
inet 10.42.42.1/24 brd 10.42.42.255 scope global eth1
   valid_lft forever preferred_lft forever
inet 10.42.42.2/24 brd 10.42.42.255 scope global secondary eth1:0
   valid_lft forever preferred_lft forever
inet 10.42.42.3/24 brd 10.42.42.255 scope global secondary eth1:1
   valid_lft forever preferred_lft forever

Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
---
M src/osmo_gsm_tester/util.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/64/3464/1

diff --git a/src/osmo_gsm_tester/util.py b/src/osmo_gsm_tester/util.py
index 266243c..602ae45 100644
--- a/src/osmo_gsm_tester/util.py
+++ b/src/osmo_gsm_tester/util.py
@@ -44,7 +44,7 @@
 proc = subprocess.Popen(['ip', 'addr', 'show', 'dev', iface], 
stdout=subprocess.PIPE, universal_newlines=True)
 for line in proc.stdout.readlines():
 if 'inet' in line and ' ' + ip + '/' in line:
-return iface
+return line.split()[-1]
 except Exception as e:
 pass
 return None

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia66e6fd8138fc11a70437a573128aacf6a01b8ff
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[MERGED] osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests

2017-08-10 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: esme: Add cleanup function to avoid cascade failure of tests
..


esme: Add cleanup function to avoid cascade failure of tests

In commit 6100b629e55ed4aa319f46ad797741131b9da8e7 I assumed esme
already had a cleanup function, which doesn't seem to be the case. This
means if a test calls esme.connect() and fails afterwards without
calling esme.disconnect(), the connection will be kept but as the test
will finish and the NITB is closed, then the connection will be kept
forever in an erroneous state. With the cleanup function we ensure we
will close the connection after the test.

Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
---
M src/osmo_gsm_tester/esme.py
M src/osmo_gsm_tester/suite.py
2 files changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py
index 7063c33..376152a 100644
--- a/src/osmo_gsm_tester/esme.py
+++ b/src/osmo_gsm_tester/esme.py
@@ -52,6 +52,9 @@
 self.next_user_message_reference = 1
 
 def __del__(self):
+self.cleanup()
+
+def cleanup(self):
 try:
 self.disconnect()
 except smpplib.exceptions.ConnectionError:
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d510b93..2ac2062 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -368,6 +368,7 @@
 
 def esme(self):
 esme_obj = esme.Esme(self.msisdn())
+self.register_for_cleanup(esme_obj)
 return esme_obj
 
 def msisdn(self):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests

2017-08-10 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

Tested locally in an env where an esme test fails and then the next one used to 
fail too due to the hanging old conn.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: esme: Add cleanup function to avoid cascade failure of tests

2017-08-10 Thread Pau Espin Pedrol

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

esme: Add cleanup function to avoid cascade failure of tests

In commit 6100b629e55ed4aa319f46ad797741131b9da8e7 I assumed esme
already had a cleanup function, which doesn't seem to be the case. This
means if a test calls esme.connect() and fails afterwards without
calling esme.disconnect(), the connection will be kept but as the test
will finish and the NITB is closed, then the connection will be kept
forever in an erroneous state. With the cleanup function we ensure we
will close the connection after the test.

Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
---
M src/osmo_gsm_tester/esme.py
M src/osmo_gsm_tester/suite.py
2 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/63/3463/1

diff --git a/src/osmo_gsm_tester/esme.py b/src/osmo_gsm_tester/esme.py
index 7063c33..376152a 100644
--- a/src/osmo_gsm_tester/esme.py
+++ b/src/osmo_gsm_tester/esme.py
@@ -52,6 +52,9 @@
 self.next_user_message_reference = 1
 
 def __del__(self):
+self.cleanup()
+
+def cleanup(self):
 try:
 self.disconnect()
 except smpplib.exceptions.ConnectionError:
diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py
index d510b93..2ac2062 100644
--- a/src/osmo_gsm_tester/suite.py
+++ b/src/osmo_gsm_tester/suite.py
@@ -368,6 +368,7 @@
 
 def esme(self):
 esme_obj = esme.Esme(self.msisdn())
+self.register_for_cleanup(esme_obj)
 return esme_obj
 
 def msisdn(self):

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3a23bb8bbccfe7ac5c544521b5566164609f0a5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc

2017-08-10 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

This commit was reverted a while ago because merge of the osmo-bts was delayed 
for a while, and meanwhile removing the config option broke the tests. Now that 
the osmo-bts commit is merged, tests are failing because the option doesn't 
exist anymore. I rebased it on top of current osmo-gsm-tester master and run it 
-> it fixes the breakage, merging.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc

2017-08-10 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: osmo-bts-trx config: remove settsc
..


osmo-bts-trx config: remove settsc

In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config
item is being removed. To be able to test it, drop the settsc option from the
config.

Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
---
M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
index 1737947..9ef2547 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -21,7 +21,6 @@
  ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0
  oml remote-ip ${osmo_bts_trx.oml_remote_ip}
  pcu-socket ${osmo_bts_trx.pcu_socket_path}
- settsc
  gsmtap-sapi bcch
  gsmtap-sapi ccch
  gsmtap-sapi rach

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: osmo-bts-trx config: remove settsc

2017-08-10 Thread Pau Espin Pedrol

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

osmo-bts-trx config: remove settsc

In osmo-bts change I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c the settsc config
item is being removed. To be able to test it, drop the settsc option from the
config.

Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
---
M src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/62/3462/1

diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
index 1737947..9ef2547 100644
--- a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -21,7 +21,6 @@
  ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0
  oml remote-ip ${osmo_bts_trx.oml_remote_ip}
  pcu-socket ${osmo_bts_trx.pcu_socket_path}
- settsc
  gsmtap-sapi bcch
  gsmtap-sapi ccch
  gsmtap-sapi rach

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58002a84b6b0104de4fb5c7cade27b263e375c1f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] openbsc[master]: libmsc: gsm340_gen_oa_sub() may return negative value

2017-08-10 Thread Pablo Neira Ayuso

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

libmsc: gsm340_gen_oa_sub() may return negative value

gsm340_gen_oa() returns a negative value if the output buffer that the
caller passes is too small, so we have to check the return value of this
function.

Fixes: CID 174178
Fixes: CID 174179
Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb
---
M openbsc/src/libmsc/gsm_04_11.c
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/3461/1

diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 73e0f55..8b4ffce 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -213,9 +213,9 @@
 {
uint8_t *smsp;
uint8_t oa[12]; /* max len per 03.40 */
-   uint8_t oa_len = 0;
uint8_t octet_len;
unsigned int old_msg_len = msg->len;
+   int oa_len;
 
/* generate first octet with masked bits */
smsp = msgb_put(msg, 1);
@@ -233,6 +233,9 @@
 
/* generate originator address */
oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), >src);
+   if (oa_len < 0)
+   return -ENOSPC;
+
smsp = msgb_put(msg, oa_len);
memcpy(smsp, oa, oa_len);
 
@@ -282,9 +285,9 @@
 struct gsm_sms *sms)
 {
unsigned int old_msg_len = msg->len;
-   uint8_t oa_len = 0;
uint8_t oa[12]; /* max len per 03.40 */
uint8_t *smsp;
+   int oa_len;
 
/* generate first octet with masked bits */
smsp = msgb_put(msg, 1);
@@ -296,8 +299,12 @@
/* TP-MR (message reference) */
smsp = msgb_put(msg, 1);
*smsp = sms->msg_ref;
+
/* generate recipient address */
oa_len = gsm340_gen_oa_sub(oa, sizeof(oa), >dst);
+   if (oa_len < 0)
+   return -ENOSPC;
+
smsp = msgb_put(msg, oa_len);
memcpy(smsp, oa, oa_len);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47215d7d89771730a7f84efa8aeeb187a0911fdb
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso