Change in ...osmocom-bb[master]: trx_toolkit/trx_sniff.py: properly handle unknown header version error

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/15300 )

Change subject: trx_toolkit/trx_sniff.py: properly handle unknown header 
version error
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie04782ced1fab7bc363549bfa37528f5a124e99d
Gerrit-Change-Number: 15300
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:47:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...libosmocore[master]: fix: vty crash by logging to killed telnet session

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/15265 )

Change subject: fix: vty crash by logging to killed telnet session
..


Patch Set 2:

I'm actually with Pau on this one, and I would have independently "complained" 
about it in the review, if he hadn't brought it up.  At the very least the root 
cause should be fixed, and then as a second, less important item we can discuss 
whether or not we should emply 'defensive programming' by checking for null 
here.  I would actually rather OSMO_ASSERT on NULL situations, rather than 
silently dropping it.


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idca3f54dc986abf6784790c12e69e02bdf77cb41
Gerrit-Change-Number: 15265
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:46:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: gsm_08_08.c: always pick first msc for unsolicit paging responses

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/15209 )

Change subject: gsm_08_08.c: always pick first msc for unsolicit paging 
responses
..

gsm_08_08.c: always pick first msc for unsolicit paging responses

When osmo-bsc receives a paging response via the A-bis interface it
tries to find the MSC which is in charge for the paging. This is due to
the fact that osmo-bsc supports multiple msc connections, which is not
specified by 3gpp specs.

In an MT-CSFB call the MSC pages the UE via the SGs interface. Then the
UE falls back to 2G. It then reports back as MS on the A-Bis interface
with the paging response directly. In those cases osmo-bsc will not be
able to determine an MSC in charge, so we will forward the paging
response to the first configured MSC.

Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Related: SYS#4624
---
M src/osmo-bsc/gsm_08_08.c
1 file changed, 16 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/gsm_08_08.c b/src/osmo-bsc/gsm_08_08.c
index 4dc4883..43117a8 100644
--- a/src/osmo-bsc/gsm_08_08.c
+++ b/src/osmo-bsc/gsm_08_08.c
@@ -323,8 +323,8 @@
subscr = extract_sub(conn, msg);

if (!subscr) {
-   LOGP(DMSC, LOGL_ERROR, "Got paged but no subscriber found.\n");
-   return NULL;
+   LOGP(DMSC, LOGL_INFO, "Got paging response but no subscriber 
found, will now (blindly) deliver the paging response to the first configured 
MSC!\n");
+   goto blind;
}

pag_msc = paging_get_msc(conn_get_bts(conn), subscr);
@@ -344,7 +344,20 @@
return msc;
}

-   LOGP(DMSC, LOGL_ERROR, "Got paged but no request found.\n");
+   LOGP(DMSC, LOGL_INFO, "Got paging response but no request found, will 
now (blindly) deliver the paging response to the first configured MSC!\n");
+
+blind:
+   /* In the case of an MT CSFB call we will get a paging response from
+* the BTS without a preceding paging request via A-Interface. In those
+* cases the MSC will page the subscriber via SGs interface, so the BSC
+* can not know about the paging in advance. In those cases we can not
+* know the MSC which is in charge. The only meaningful option we have
+* is to deliver the paging response to the first configured MSC
+* blindly. */
+   msc = llist_first_entry_or_null(>mscs, struct bsc_msc_data, entry);
+   if (msc)
+   return msc;
+   LOGP(DMSC, LOGL_ERROR, "Unable to find any suitable MSC to deliver 
paging response!\n");
return NULL;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Gerrit-Change-Number: 15209
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


Change in ...osmo-bsc[master]: gsm_08_08.c: always pick first msc for unsolicit paging responses

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/15209 )

Change subject: gsm_08_08.c: always pick first msc for unsolicit paging 
responses
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Gerrit-Change-Number: 15209
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:43:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...docker-playground[master]: ttcn3-ggsn: Disable echo-timer test when running against latest

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/docker-playground/+/15284 )

Change subject: ttcn3-ggsn: Disable echo-timer test when running against latest
..

ttcn3-ggsn: Disable echo-timer test when running against latest

Change-Id: I6657eefed00df96e3bcdca174a6ea0be1897b762
---
M ttcn3-ggsn-test/GGSN_Tests.cfg
M ttcn3-ggsn-test/jenkins.sh
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved; Verified



diff --git a/ttcn3-ggsn-test/GGSN_Tests.cfg b/ttcn3-ggsn-test/GGSN_Tests.cfg
index 064bf37..11c22cb 100644
--- a/ttcn3-ggsn-test/GGSN_Tests.cfg
+++ b/ttcn3-ggsn-test/GGSN_Tests.cfg
@@ -18,5 +18,7 @@
 # GGSN announced DNS address
 GGSN_Tests.m_ggsn_ip4_dns1 := "172.18.3.201"

+GGSN_Tests.m_ggsn_supports_echo_interval := true;
+
 [EXECUTE]
 GGSN_Tests.control
diff --git a/ttcn3-ggsn-test/jenkins.sh b/ttcn3-ggsn-test/jenkins.sh
index 4250e4d..c4fac9d 100755
--- a/ttcn3-ggsn-test/jenkins.sh
+++ b/ttcn3-ggsn-test/jenkins.sh
@@ -10,6 +10,10 @@

 mkdir $VOL_BASE_DIR/ggsn-tester
 cp GGSN_Tests.cfg $VOL_BASE_DIR/ggsn-tester/
+# VTY command "(no) echo-interval" must be disabled until osmo-ggsn.git 
release > 1.4.0 is available.
+if [ "$IMAGE_SUFFIX" = "latest" ]; then
+   sed "s/GGSN_Tests.m_ggsn_supports_echo_interval := 
true;/GGSN_Tests.m_ggsn_supports_echo_interval := false;/g" -i 
$VOL_BASE_DIR/ggsn-tester/GGSN_Tests.cfg
+fi

 mkdir $VOL_BASE_DIR/ggsn
 cp osmo-ggsn.cfg $VOL_BASE_DIR/ggsn/

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/15284
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I6657eefed00df96e3bcdca174a6ea0be1897b762
Gerrit-Change-Number: 15284
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: fix segfault: don't send CC REL on NULL msc_a

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15314 )

Change subject: fix segfault: don't send CC REL on NULL msc_a
..

fix segfault: don't send CC REL on NULL msc_a

Apparently, if a conn disappears during an ongoing call, the CC code tried to
send a CC REL on a NULL msc_a during cleanup, which lead to a crash
(cccamp2019). Guard against that.

Crash:

 #0  msc_a_tx_dtap_to_i (msc_a=0x0, dtap=0x55a4bf2fa0f0) at 
../../../../src/osmo-msc/src/libmsc/msc_a.c:1565
 #1  0x55a4be1bb03c in trans_tx_gsm48 (trans=0x55a4bf2d52a0, 
trans=0x55a4bf2d52a0, trans=0x55a4bf2d52a0, msg=)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:82
 #2  gsm48_cc_tx_release (trans=trans@entry=0x55a4bf2d52a0, 
arg=arg@entry=0x7ffdd731a0e0) at 
../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:1101
 #3  0x55a4be1bee65 in _gsm48_cc_trans_free 
(trans=trans@entry=0x55a4bf2d52a0) at 
../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:278
 #4  0x55a4be1ab654 in trans_free (trans=trans@entry=0x55a4bf2d52a0) at 
../../../../src/osmo-msc/src/libmsc/transaction.c:170
 #5  0x55a4be1bd091 in mncc_tx_to_gsm_cc (net=, 
msg=msg@entry=0x55a4bf2d3b68)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:1971
 #6  0x55a4be1bf1e5 in mncc_tx_to_cc (net=, 
arg=arg@entry=0x55a4bf2d3b68)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:2049
 #7  0x55a4be18ed63 in mncc_sock_read (bfd=0x55a4bf2563b8, 
bfd=0x55a4bf2563b8) at ../../../../src/osmo-msc/src/libmsc/mncc_sock.c:121
 #8  mncc_sock_cb (bfd=0x55a4bf2563b8, flags=1) at 
../../../../src/osmo-msc/src/libmsc/mncc_sock.c:189
 #9  0x7fcfad607ce1 in osmo_fd_disp_fds (_eset=0x7ffdd731a9a0, 
_wset=0x7ffdd731a920, _rset=0x7ffdd731a8a0)
 at ../../../src/libosmocore/src/select.c:223
 #10 osmo_select_main (polling=) at 
../../../src/libosmocore/src/select.c:263
 #11 0x55a4be17dd56 in main (argc=3, argv=) at 
../../../../src/osmo-msc/src/osmo-msc/msc_main.c:723

Change-Id: Ia1bb0410ad0618c182a5f6da06af342b6d483eff
---
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/msc_a.c
2 files changed, 19 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index a1fea9a..ba6a197 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1076,8 +1076,16 @@
 static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg)
 {
struct gsm_mncc *rel = arg;
-   struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL");
-   struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
+   struct msgb *msg;
+   struct gsm48_hdr *gh;
+
+   if (!trans->msc_a) {
+   LOG_TRANS(trans, LOGL_DEBUG, "Cannot send CC REL, there is no 
MSC-A connection\n");
+   return -EINVAL;
+   }
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL");
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));

gh->msg_type = GSM48_MT_CC_RELEASE;

diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 553761f..b3e2e32 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1562,6 +1562,15 @@
 {
struct ran_msg ran_msg;

+   if (!msc_a) {
+   struct gsm48_hdr *gh = msgb_l3(dtap) ? : dtap->data;
+   uint8_t pdisc = gsm48_hdr_pdisc(gh);
+   LOGP(DMSC, LOGL_ERROR, "Attempt to send DTAP to NULL MSC-A, 
dropping message: %s %s\n",
+gsm48_pdisc_name(pdisc), gsm48_pdisc_msgtype_name(pdisc, 
gsm48_hdr_msg_type(gh)));
+   msgb_free(dtap);
+   return -EIO;
+   }
+
if (msc_a->c.ran->type == OSMO_RAT_EUTRAN_SGS) {
/* The SGs connection to the MME always is at the MSC-A. */
return sgs_iface_tx_dtap_ud(msc_a, dtap);

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia1bb0410ad0618c182a5f6da06af342b6d483eff
Gerrit-Change-Number: 15314
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...docker-playground[master]: ttcn3-ggsn: Disable echo-timer test when running against latest

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/15284 )

Change subject: ttcn3-ggsn: Disable echo-timer test when running against latest
..


Patch Set 1: Verified+1 Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/15284
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I6657eefed00df96e3bcdca174a6ea0be1897b762
Gerrit-Change-Number: 15284
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:42:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: tweak CC cause for incoming call to unattached nr

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15316 )

Change subject: tweak CC cause for incoming call to unattached nr
..

tweak CC cause for incoming call to unattached nr

So far we sent CC cause "Unassigned Number"

But the MSC doesn't trivially know whether the HLR has the number assigned or
not: any handset that is currently switched off would cause "Unassigned number"
to be displayed on the caller's handset.

Rather send a temporary failure cause code.

Send this cause code for all cases, because claiming that an assigned number is
unassigned is worse than rejecting an unassigned number with a temporary
failure.

Change-Id: Ia3d4f67b53fcc2654ff048fbc338e92cb763a095
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index ba6a197..1ec3342 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1892,7 +1892,7 @@
}
if (!vsub)
return mncc_release_ind(net, NULL, data->callref, 
GSM48_CAUSE_LOC_PRN_S_LU,
-   GSM48_CC_CAUSE_UNASSIGNED_NR);
+   GSM48_CC_CAUSE_USER_NOTRESPOND);
/* update the subscriber we deal with */
log_set_context(LOG_CTX_VLR_SUBSCR, vsub);


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15316
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d4f67b53fcc2654ff048fbc338e92cb763a095
Gerrit-Change-Number: 15316
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15315 )

Change subject: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD
..

vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD

Change-Id: I2ea4f46efa013671d93892cb07bf830393289150
---
M src/libvlr/vlr_lu_fsm.c
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
2 files changed, 7 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c
index 454709f..2db5711 100644
--- a/src/libvlr/vlr_lu_fsm.c
+++ b/src/libvlr/vlr_lu_fsm.c
@@ -1234,6 +1234,10 @@
}
}
break;
+   case VLR_ULA_E_ID_IMEI:
+   case VLR_ULA_E_ID_IMEISV:
+   /* Got the IMEI from ME, nothing to do right now though. */
+   break;
default:
OSMO_ASSERT(0);
break;
@@ -1400,7 +1404,9 @@
},
[VLR_ULA_S_WAIT_HLR_UPD] = {
.in_event_mask = S(VLR_ULA_E_HLR_LU_RES) |
-S(VLR_ULA_E_UPD_HLR_COMPL),
+S(VLR_ULA_E_UPD_HLR_COMPL) |
+S(VLR_ULA_E_ID_IMEI) |
+S(VLR_ULA_E_ID_IMEISV),
.out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) |
  S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) |
  S(VLR_ULA_S_DONE),
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err 
b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 893203e..7b9970d 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -1789,7 +1789,6 @@
 DVLR set IMEISV on subscriber; IMSI=90170004620 IMEISV=4234234234234275
 DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=42342342342342
 DVLR vlr_lu_fsm(IMSI-90170004620:GERAN-A:LU){VLR_ULA_S_WAIT_HLR_UPD}: 
Received Event VLR_ULA_E_ID_IMEISV
-DVLR vlr_lu_fsm(IMSI-90170004620:GERAN-A:LU){VLR_ULA_S_WAIT_HLR_UPD}: 
Event VLR_ULA_E_ID_IMEISV not permitted
 DREF msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: - 
ms_sends_ciphering_mode_complete: now used by 1 (lu)
   lu_result_sent == 0
 - Subscriber has the IMEISV

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15315
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I2ea4f46efa013671d93892cb07bf830393289150
Gerrit-Change-Number: 15315
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: tweak CC cause for incoming call to unattached nr

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15316 )

Change subject: tweak CC cause for incoming call to unattached nr
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15316
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d4f67b53fcc2654ff048fbc338e92cb763a095
Gerrit-Change-Number: 15316
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:42:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15315 )

Change subject: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15315
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I2ea4f46efa013671d93892cb07bf830393289150
Gerrit-Change-Number: 15315
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:40:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: fix segfault: don't send CC REL on NULL msc_a

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15314 )

Change subject: fix segfault: don't send CC REL on NULL msc_a
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia1bb0410ad0618c182a5f6da06af342b6d483eff
Gerrit-Change-Number: 15314
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:40:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: fix error on BSSMAP Cipher Mode Complete L3 msg IE

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15317 )

Change subject: fix error on BSSMAP Cipher Mode Complete L3 msg IE
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/15317/3/src/libmsc/msc_a.c
File src/libmsc/msc_a.c:

https://gerrit.osmocom.org/#/c/15317/3/src/libmsc/msc_a.c@1411
PS3, Line 1411: but this static msgb saves the extra allocation
I'm really not sure if this is the right approach.  No code in the osmocom 
universe ever assumes msgbs are on the stack, or which may not have gone 
through normal libosmocore handling.  What if somebody later for some reason 
wants to put this on a queue?  How does msgb ownership work out here?

To me, it looks like a very dangerous premature optimization with potential to 
waste a lot of time and effort at some potential future point of development.



--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15317
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
Gerrit-Change-Number: 15317
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:39:32 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: cc trans: make sure bearer cap is empty

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15320 )

Change subject: cc trans: make sure bearer cap is empty
..

cc trans: make sure bearer cap is empty

Change-Id: I147f10f9258fc8685f2f666878dd2a655b8e4583
---
M src/libmsc/transaction.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index ebdaced..11cde93 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -147,6 +147,10 @@
.transaction_id = trans_id,
.callref = callref,
.net = net,
+   /* empty bearer_cap: make sure the speech_ver array is empty */
+   .bearer_cap = {
+   .speech_ver = { -1 },
+   },
};
vlr_subscr_get(vsub, trans_vsub_use(type));
llist_add_tail(>entry, >trans_list);

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15320
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I147f10f9258fc8685f2f666878dd2a655b8e4583
Gerrit-Change-Number: 15320
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: memleak on cc setup errors

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15319 )

Change subject: memleak on cc setup errors
..

memleak on cc setup errors

Change-Id: Ib90064575b270627721ace7e07d085f4ad43
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index f974e90..a1fea9a 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -598,6 +598,7 @@
  GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
trans->callref = 0;
trans_free(trans);
+   msgb_free(msg);
return rc;
}

@@ -610,6 +611,7 @@
  GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
trans->callref = 0;
trans_free(trans);
+   msgb_free(msg);
return rc;
}
trans->transaction_id = trans_id;

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15319
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ib90064575b270627721ace7e07d085f4ad43
Gerrit-Change-Number: 15319
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: cc trans: make sure bearer cap is empty

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15320 )

Change subject: cc trans: make sure bearer cap is empty
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15320
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I147f10f9258fc8685f2f666878dd2a655b8e4583
Gerrit-Change-Number: 15320
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:39:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: memleak on cc setup errors

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15319 )

Change subject: memleak on cc setup errors
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15319
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ib90064575b270627721ace7e07d085f4ad43
Gerrit-Change-Number: 15319
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:39:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: log, cosmetic: add "RR" to "Ciphering Mode Complete"

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15318 )

Change subject: log, cosmetic: add "RR" to "Ciphering Mode Complete"
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15318
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I80c69b491e2ddb932bc4295a01caaf6a903b1fe4
Gerrit-Change-Number: 15318
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:36:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...pysim[master]: make writing SMSP optional

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/15312 )

Change subject: make writing SMSP optional
..


Patch Set 1:

> I was kind of expecting a cmdline switch to go along with this?

Som upcoming changes will make use of it.


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
Gerrit-Change-Number: 15312
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:35:34 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...pysim[master]: Make programming OPC optional

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/pysim/+/15311 )

Change subject: Make programming OPC optional
..

Make programming OPC optional

Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
---
M pySim/cards.py
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/pySim/cards.py b/pySim/cards.py
index a341b71..cb42d83 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -582,9 +582,9 @@
data, sw = self._scc.update_binary('00FF', p['ki'])

# set OPc in proprietary file
-   content = "01" + p['opc']
-   data, sw = self._scc.update_binary('00F7', content)
-
+   if 'opc' in p:
+   content = "01" + p['opc']
+   data, sw = self._scc.update_binary('00F7', content)

# write EF.IMSI
data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi']))

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
Gerrit-Change-Number: 15311
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


Change in ...pysim[master]: Make programming OPC optional

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/15311 )

Change subject: Make programming OPC optional
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
Gerrit-Change-Number: 15311
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:34:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_echo_timeout

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15306 )

Change subject: sgsn: Introduce test TC_attach_echo_timeout
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15306
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic31748924e7bf05ea2ccf2b1be0c460eefed5782
Gerrit-Change-Number: 15306
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:34:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Proper shutdown of RAN_Adapter components

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15295 )

Change subject: sgsn: Proper shutdown of RAN_Adapter components
..


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/15295/2/library/RAN_Adapter.ttcnpp
File library/RAN_Adapter.ttcnpp:

https://gerrit.osmocom.org/#/c/15295/2/library/RAN_Adapter.ttcnpp@196
PS2, Line 196: ba.vc_RAN_started
one could probably simply test for "ba.vc_RAN != null" here.  Or you could 
actually check for "if ba.vc_RAN:RANAP.checkstate("Connected")" like we do in 
other places.  I don't think there's a need for inroduction of 
ba.vc_RAN_started, neither is it elegant to add a variable and thus keep 
redundant state information which may be out of sync if somebody else might 
already have disconnected the port or stopped a component, or...



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15295
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I471eb851e5d41de5d8d974ec81be27024d7d313a
Gerrit-Change-Number: 15295
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:34:11 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-sip-connector[master]: mncc: do not unregister unregistered osmo fds

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303 )

Change subject: mncc: do not unregister unregistered osmo fds
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c
File src/mncc.c:

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c@329
PS2, Line 329:  close(conn->fd.fd);
> I'm also wondering. […]
the normal solution employed in various other examples is to set 'conn->fd.fd = 
-1" at every close.  This way you can then check "if (conn->fd.fd != -1)" or 
"if (conn->fd.fd >= 0)" around the fd_unregister+close.



--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Gerrit-Change-Number: 15303
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:30:22 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


Change in ...libosmo-sccp[master]: osmo_sccp_simple_client(): use sccp instance index 0 instead of 1

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15062 )

Change subject: osmo_sccp_simple_client(): use sccp instance index 0 instead of 
1
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15062
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9d9f6b9cdc1e3c697c8b834528d51878e1ae
Gerrit-Change-Number: 15062
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:28:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: Move pdp_get_peer_ipv() to lib/util.*

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15250 )

Change subject: Move pdp_get_peer_ipv() to lib/util.*
..

Move pdp_get_peer_ipv() to lib/util.*

Preparation for next commit, where this function will be needed inside
libmisc (lib/*).

Change-Id: Ibab4f6c09d1e5f0e9cfaea28ae1e7ab5b5c219b5
---
M ggsn/ggsn.c
M ggsn/ggsn.h
M ggsn/ggsn_vty.c
M ggsn/pco.c
M lib/Makefile.am
A lib/util.c
A lib/util.h
7 files changed, 60 insertions(+), 23 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index c7756d9..4e13151 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -51,6 +51,7 @@
 #include "../lib/syserr.h"
 #include "../lib/in46_addr.h"
 #include "../lib/gtp-kernel.h"
+#include "../lib/util.h"
 #include "../gtp/pdp.h"
 #include "../gtp/gtp.h"
 #include "icmpv6.h"
@@ -365,26 +366,6 @@
return 0;
 }

-/*! Get the peer of pdp based on IP version used.
- *  \param[in] pdp PDP context to select the peer from.
- *  \param[in] v4v6 IP version to select. Valid values are 4 and 6.
- *  \returns The selected peer matching the given IP version. NULL if not 
present.
- */
-struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) {
-   uint8_t i;
-
-   for (i = 0; i < 2; i++) {
-   struct ippoolm_t * ippool = pdp->peer[i];
-   if (!ippool)
-   continue;
-   if (is_ipv6 && in46a_is_v6(>addr))
-   return ippool;
-   else if (!is_ipv6 && in46a_is_v4(>addr))
-   return ippool;
-   }
-   return NULL;
-}
-
 static bool apn_supports_ipv4(const struct apn_ctx *apn)
 {
if (apn->v4.cfg.static_prefix.addr.len  || 
apn->v4.cfg.dynamic_prefix.addr.len)
diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h
index 1bd067e..88fd8b9 100644
--- a/ggsn/ggsn.h
+++ b/ggsn/ggsn.h
@@ -145,7 +145,6 @@
 extern int ggsn_stop(struct ggsn_ctx *ggsn);
 extern int apn_start(struct apn_ctx *apn);
 extern int apn_stop(struct apn_ctx *apn);
-extern struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6);

 #define LOGPAPN(level, apn, fmt, args...)  \
LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args)
diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index 0a86f49..b85df77 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -37,6 +37,8 @@
 #include "../gtp/gtp.h"
 #include "../gtp/pdp.h"

+#include "../lib/util.h"
+
 #include "ggsn.h"

 #define PREFIX_STR "Prefix (Network/Netmask)\n"
diff --git a/ggsn/pco.c b/ggsn/pco.c
index 5715865..e2181e1 100644
--- a/ggsn/pco.c
+++ b/ggsn/pco.c
@@ -17,6 +17,8 @@
 #include 
 #include 

+#include "../lib/util.h"
+
 #include "pco.h"
 #include "ggsn.h"

diff --git a/lib/Makefile.am b/lib/Makefile.am
index b6e7aba..533d777 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,10 +1,10 @@
 noinst_LIBRARIES = libmisc.a

-noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h 
netdev.h gtp-kernel.h
+noinst_HEADERS = gnugetopt.h ippool.h lookup.h syserr.h tun.h in46_addr.h 
netdev.h gtp-kernel.h util.h

 AM_CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -ggdb 
$(LIBOSMOCORE_CFLAGS)

-libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c 
in46_addr.c netdev.c
+libmisc_a_SOURCES = getopt1.c getopt.c ippool.c lookup.c tun.c debug.c 
in46_addr.c netdev.c util.c

 if ENABLE_GTP_KERNEL
 AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS)
diff --git a/lib/util.c b/lib/util.c
new file mode 100644
index 000..6bb0d85
--- /dev/null
+++ b/lib/util.c
@@ -0,0 +1,35 @@
+/*
+ * misc helpers
+ * Copyright 2019 sysmocom - s.f.m.c. GmbH 
+ *
+ * The contents of this file may be used under the terms of the GNU
+ * General Public License Version 2, provided that the above copyright
+ * notice and this permission notice is included in all copies or
+ * substantial portions of the software.
+ *
+ */
+
+#include "../gtp/pdp.h"
+
+#include "ippool.h"
+#include "in46_addr.h"
+
+/*! Get the peer of pdp based on IP version used.
+*  \param[in] pdp PDP context to select the peer from.
+*  \param[in] v4v6 IP version to select. Valid values are 4 and 6.
+*  \returns The selected peer matching the given IP version. NULL if not 
present.
+*/
+struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) {
+   uint8_t i;
+
+   for (i = 0; i < 2; i++) {
+   struct ippoolm_t * ippool = pdp->peer[i];
+   if (!ippool)
+   continue;
+   if (is_ipv6 && in46a_is_v6(>addr))
+   return ippool;
+   else if (!is_ipv6 && in46a_is_v4(>addr))
+   return ippool;
+   }
+   return NULL;
+}
diff --git a/lib/util.h b/lib/util.h
new file mode 100644
index 000..bc9674d
--- /dev/null
+++ 

Change in ...osmo-ggsn[master]: libgtp: Introduce cb_recovery3

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15266 )

Change subject: libgtp: Introduce cb_recovery3
..

libgtp: Introduce cb_recovery3

Since osmo-ggsn can manage several GSN structures simultaneously, it
needs the gsn_t pointer to know the ggsn it should forward the call to.

Related: OS#4165
Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
---
M gtp/gtp.c
M gtp/gtp.h
2 files changed, 23 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/gtp/gtp.c b/gtp/gtp.c
index f0318f7..f70f534 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -219,6 +219,8 @@
gsn->cb_recovery(peer, recovery);
if (gsn->cb_recovery2)
gsn->cb_recovery2(peer, pdp, recovery);
+   if (gsn->cb_recovery3)
+   gsn->cb_recovery3(gsn, peer, pdp, recovery);
 }

 int gtp_set_cb_recovery(struct gsn_t *gsn,
@@ -242,6 +244,21 @@
return 0;
 }

+/* cb_recovery()
+ * pdp may be NULL if Recovery IE was received from a message independent
+ * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
+ * local setup. In case pdp is known, caller may want to keep that pdp alive to
+ * handle subsequent msg cb as this specific pdp ctx is still valid according 
to
+ * specs.
+ */
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+int (*cb_recovery3) (struct gsn_t *gsn, struct 
sockaddr_in *peer,
+ struct pdp_t *pdp, uint8_t 
recovery))
+{
+   gsn->cb_recovery3 = cb_recovery3;
+   return 0;
+}
+
 int gtp_set_cb_data_ind(struct gsn_t *gsn,
   int (*cb_data_ind) (struct pdp_t * pdp,
   void *pack, unsigned len))
diff --git a/gtp/gtp.h b/gtp/gtp.h
index c2c5122..f2a4e1d 100644
--- a/gtp/gtp.h
+++ b/gtp/gtp.h
@@ -277,6 +277,7 @@
int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len);
int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery);
int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, 
uint8_t recovery);
+   int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, 
struct pdp_t *pdp, uint8_t recovery);

/* Counters */

@@ -373,6 +374,11 @@
 int gtp_set_cb_recovery2(struct gsn_t *gsn,
int (*cb) (struct sockaddr_in * peer,
   struct pdp_t * pdp,
+  uint8_t recovery))
+   OSMO_DEPRECATED("Use gtp_set_cb_recovery3() instead, to obtain gsn 
handling the recovery");;
+int gtp_set_cb_recovery3(struct gsn_t *gsn,
+   int (*cb) (struct gsn_t * gsn, struct sockaddr_in * 
peer,
+  struct pdp_t * pdp,
   uint8_t recovery));

 void gtp_clear_queues(struct gsn_t *gsn);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15266
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
Gerrit-Change-Number: 15266
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...libosmo-sccp[master]: osmo_sccp_simple_client(): use sccp instance index 0 instead of 1

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15062 )

Change subject: osmo_sccp_simple_client(): use sccp instance index 0 instead of 
1
..

osmo_sccp_simple_client(): use sccp instance index 0 instead of 1

When using osmo_sccp_simple_client(), it will create an sccp instance if
none exists. The sccp instance identifier starts with 0.
The implicit created instance should use sccp instance 0 (the
first connection).

Change-Id: I9d9f6b9cdc1e3c697c8b834528d51878e1ae
---
M src/sccp_user.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  neels: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/sccp_user.c b/src/sccp_user.c
index 63eba2a..ff5eb08 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -635,7 +635,7 @@
 *  the only difference is that the ID of the CS7 instance will be
 *  set to 1 statically */

-   return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot,
+   return osmo_sccp_simple_client_on_ss7_id(ctx, 0, name, default_pc, prot,
 default_local_port,
 default_local_ip,
 default_remote_port,

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15062
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9d9f6b9cdc1e3c697c8b834528d51878e1ae
Gerrit-Change-Number: 15062
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: ggsn: Split application lifecycle related code into ggsn_main.c

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15249 )

Change subject: ggsn: Split application lifecycle related code into ggsn_main.c
..

ggsn: Split application lifecycle related code into ggsn_main.c

This way we further shrink ggsn.c and leave there GGSN related code.

Change-Id: I9e6a3beac7657f0a8c02d514b54c6f1caa93bba7
---
M ggsn/Makefile.am
M ggsn/ggsn.c
M ggsn/ggsn.h
A ggsn/ggsn_main.c
4 files changed, 214 insertions(+), 176 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve



diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index 022cdef..a8ddf1e 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -12,4 +12,4 @@
 endif

 osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
-osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h icmpv6.c icmpv6.h checksum.c 
checksum.h pco.c pco.h
+osmo_ggsn_SOURCES = ggsn_main.c ggsn_vty.c ggsn.c ggsn.h icmpv6.c icmpv6.h 
checksum.c checksum.h pco.c pco.h
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 3c702c2..c7756d9 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -42,22 +42,8 @@
 #include 
 #include 

-#include 
-#include 
-#include 
-#include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 

 #include "../lib/tun.h"
@@ -71,19 +57,9 @@
 #include "pco.h"
 #include "ggsn.h"

-void *tall_ggsn_ctx;
-
-static int end = 0;
-static int daemonize = 0;
-static struct ctrl_handle *g_ctrlh;
-
-struct ul255_t qos;
-struct ul255_t apn;
-
 static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what);
 static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len);

-
 static void pool_close_all_pdp(struct ippool_t *pool)
 {
unsigned int i;
@@ -690,8 +666,6 @@
return tun_encaps((struct tun_t *)pdp->ipif, pack, len);
 }

-static char *config_file = "osmo-ggsn.cfg";
-
 /* callback for tun device osmocom select loop integration */
 static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what)
 {
@@ -749,29 +723,6 @@
ggsn_gtp_tmr_start(ggsn);
 }

-/* To exit gracefully. Used with GCC compilation flag -pg and gprof */
-static void signal_handler(int s)
-{
-   LOGP(DGGSN, LOGL_NOTICE, "signal %d received\n", s);
-   switch (s) {
-   case SIGINT:
-   case SIGTERM:
-   LOGP(DGGSN, LOGL_NOTICE, "SIGINT received, shutting down\n");
-   end = 1;
-   break;
-   case SIGABRT:
-   case SIGUSR1:
-   talloc_report(tall_vty_ctx, stderr);
-   talloc_report_full(tall_ggsn_ctx, stderr);
-   break;
-   case SIGUSR2:
-   talloc_report_full(tall_vty_ctx, stderr);
-   break;
-   default:
-   break;
-   }
-}
-
 /* libgtp callback for confirmations */
 static int cb_conf(int type, int cause, struct pdp_t *pdp, void *cbp)
 {
@@ -882,128 +833,3 @@
ggsn->started = false;
return 0;
 }
-
-static void print_usage()
-{
-   printf("Usage: osmo-ggsn [-h] [-D] [-c configfile] [-V]\n");
-}
-
-static void print_help()
-{
-   printf( "  Some useful help...\n"
-   "  -h --helpThis help text\n"
-   "  -D --daemonize   Fork the process into a background 
daemon\n"
-   "  -c --config-file filename The config file to use\n"
-   "  -V --version Print the version of OsmoGGSN\n"
-   );
-}
-
-static void handle_options(int argc, char **argv)
-{
-   while (1) {
-   int option_index = 0, c;
-   static struct option long_options[] = {
-   { "help", 0, 0, 'h' },
-   { "daemonize", 0, 0, 'D' },
-   { "config-file", 1, 0, 'c' },
-   { "version", 0, 0, 'V' },
-   { 0, 0, 0, 0 }
-   };
-
-   c = getopt_long(argc, argv, "hdc:V", long_options, 
_index);
-   if (c == -1)
-   break;
-
-   switch (c) {
-   case 'h':
-   print_usage();
-   print_help();
-   exit(0);
-   case 'D':
-   daemonize = 1;
-   break;
-   case 'c':
-   config_file = optarg;
-   break;
-   case 'V':
-   print_version(1);
-   exit(0);
-   break;
-   }
-   }
-}
-
-int main(int argc, char **argv)
-{
-   struct ggsn_ctx *ggsn;
-   int rc;
-
-   tall_ggsn_ctx = talloc_named_const(NULL, 0, "OsmoGGSN");
-   msgb_talloc_ctx_init(tall_ggsn_ctx, 0);
-   g_vty_info.tall_ctx = tall_ggsn_ctx;
-
-   /* Handle 

Change in ...osmo-ggsn[master]: ggsn_vty.c: Avoid printing duplicates for pdp context with v4v6 EUAs

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15253 )

Change subject: ggsn_vty.c: Avoid printing duplicates for pdp context with v4v6 
EUAs
..

ggsn_vty.c: Avoid printing duplicates for pdp context with v4v6 EUAs

Fixes potential duplicates when calling following VTY cmd:
show pdp-context ggsn NAME
show pdp-context ggsn NAME apn APN

Related: OS#4154
Change-Id: I98db39a710a72a1438d71aabaf4f8227984643e3
---
M ggsn/ggsn_vty.c
1 file changed, 24 insertions(+), 10 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve



diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index b85df77..a649173 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -734,13 +734,22 @@
return in46a_ntoa();
 }

-static void show_one_pdp(struct vty *vty, struct pdp_t *pdp)
+/* Useful for v4v6 APNs, where we first iterate over v4 pool and then over v6
+   pool. param v4only can be used to avoid printing duplicates for pdp context
+   containing both IPv4 and IPv6 addresses. */
+static void show_one_pdp_v4only(struct vty *vty, struct pdp_t *pdp, bool 
v4only)
 {
-   struct ippoolm_t *peer;
+   struct ippoolm_t *peer4, *peer6;
char name_buf[256];
char *apn_name;
int rc;

+   peer4 = pdp_get_peer_ipv(pdp, false);
+   peer6 = pdp_get_peer_ipv(pdp, true);
+
+   if (v4only && peer6)
+   return;
+
/* Attempt to decode MSISDN */
rc = gsm48_decode_bcd_number2(name_buf, sizeof(name_buf),
  pdp->msisdn.v, pdp->msisdn.l, 0);
@@ -759,16 +768,21 @@
apn_name = osmo_apn_to_str(name_buf, pdp->apn_use.v, pdp->apn_use.l);
vty_out(vty, " APN in use: %s%s", apn_name ? name_buf : "(NONE)", 
VTY_NEWLINE);

-   if ((peer = pdp_get_peer_ipv(pdp, false)))
+   if (peer4)
vty_out(vty, " End-User Address (IPv4): %s%s",
-   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
-   if ((peer = pdp_get_peer_ipv(pdp, true)))
+   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
+   if (peer6)
vty_out(vty, " End-User Address (IPv6): %s%s",
-   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
+   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
vty_out(vty, " Transmit GTP Sequence Number for G-PDU: %s%s",
pdp->tx_gpdu_seq ? "Yes" : "No", VTY_NEWLINE);
 }

+static void show_one_pdp(struct vty *vty, struct pdp_t *pdp)
+{
+   show_one_pdp_v4only(vty, pdp, false);
+}
+
 DEFUN(show_pdpctx_imsi, show_pdpctx_imsi_cmd,
"show pdp-context ggsn NAME imsi IMSI [<0-15>]",
SHOW_STR "Display information on PDP Context\n"
@@ -853,7 +867,7 @@
 }

 /* show all (active) PDP contexts within a pool */
-static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool)
+static void ippool_show_pdp_contexts(struct vty *vty, struct ippool_t *pool, 
bool pdp_v4only)
 {
unsigned int i;

@@ -864,15 +878,15 @@
struct ippoolm_t *member = >member[i];
if (member->inuse == 0)
continue;
-   show_one_pdp(vty, member->peer);
+   show_one_pdp_v4only(vty, member->peer, pdp_v4only);
}
 }

 /* show all (active) PDP contexts within an APN */
 static void apn_show_pdp_contexts(struct vty *vty, struct apn_ctx *apn)
 {
-   ippool_show_pdp_contexts(vty, apn->v4.pool);
-   ippool_show_pdp_contexts(vty, apn->v6.pool);
+   ippool_show_pdp_contexts(vty, apn->v4.pool, true);
+   ippool_show_pdp_contexts(vty, apn->v6.pool, false);
 }

 DEFUN(show_pdpctx, show_pdpctx_cmd,

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15253
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I98db39a710a72a1438d71aabaf4f8227984643e3
Gerrit-Change-Number: 15253
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: libgtp: Introduce cb_recovery3

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15266 )

Change subject: libgtp: Introduce cb_recovery3
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15266
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
Gerrit-Change-Number: 15266
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:27:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: pdp: constify param in pdp_count_secondary()

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15255 )

Change subject: pdp: constify param in pdp_count_secondary()
..

pdp: constify param in pdp_count_secondary()

Change-Id: Ie772f2c54264c8bc91f50d9030479861dd8868b7
---
M gtp/pdp.c
M gtp/pdp.h
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/gtp/pdp.c b/gtp/pdp.c
index eaef545..739cf73 100644
--- a/gtp/pdp.c
+++ b/gtp/pdp.c
@@ -359,7 +359,7 @@

 /* Count amount of secondary PDP contexts linked to this primary PDP context
  * (itself included). Must be called on a primary PDP context. */
-unsigned int pdp_count_secondary(struct pdp_t *pdp)
+unsigned int pdp_count_secondary(const struct pdp_t *pdp)
 {
unsigned int n;
unsigned int count = 0;
diff --git a/gtp/pdp.h b/gtp/pdp.h
index fdfa824..4dcdde4 100644
--- a/gtp/pdp.h
+++ b/gtp/pdp.h
@@ -263,7 +263,7 @@
 uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi);
 void pdp_set_imsi_nsapi(struct pdp_t *pdp, uint64_t teid);

-unsigned int pdp_count_secondary(struct pdp_t *pdp);
+unsigned int pdp_count_secondary(const struct pdp_t *pdp);

 /* Deprecated APIs (support for only 1 GSN per process). Must be used only 
after first call to gtp_new() and until it is freed. */
 int pdp_init(struct gsn_t *gsn); /* Use only allowed inside libgtp to keep 
compatiblity with deprecated APIs defined here. */

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15255
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie772f2c54264c8bc91f50d9030479861dd8868b7
Gerrit-Change-Number: 15255
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: gtp-kernel.c: Fix wrong use of in46a_from_eua, print IPv6 euas

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15251 )

Change subject: gtp-kernel.c: Fix wrong use of in46a_from_eua, print IPv6 euas
..

gtp-kernel.c: Fix wrong use of in46a_from_eua, print IPv6 euas

in46a_from_eua() API documentation clearly states an array of 2 items
should be passed as pointer, but show_one_pdp() was passing only one,
which would end up in out-of-bounds writes on v4v6 EUAs.

Let's better use ippool to print allocated ip addresses instead of
parsing EUAs we sent some point in the past.

Change-Id: I7e164f40f50de43027bcd4464aa879450d2fb10e
---
M lib/gtp-kernel.c
1 file changed, 13 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve



diff --git a/lib/gtp-kernel.c b/lib/gtp-kernel.c
index 48811bc..f6df408 100644
--- a/lib/gtp-kernel.c
+++ b/lib/gtp-kernel.c
@@ -26,6 +26,8 @@

 #include "../lib/tun.h"
 #include "../lib/syserr.h"
+#include "../lib/util.h"
+#include "../lib/ippool.h"
 #include "../gtp/pdp.h"
 #include "../gtp/gtp.h"

@@ -37,16 +39,23 @@

 static void pdp_debug(const char *prefix, const char *devname, struct pdp_t 
*pdp)
 {
-   struct in46_addr ia46;
+   char buf4[INET_ADDRSTRLEN], buf6[INET6_ADDRSTRLEN];
+   struct ippoolm_t *peer;
struct in_addr ia;

-   in46a_from_eua(>eua, );
+   buf4[0] = '\0';
+   if ((peer = pdp_get_peer_ipv(pdp, false)))
+   in46a_ntop(>addr, buf4, sizeof(buf4));
+   buf6[0] = '\0';
+   if ((peer = pdp_get_peer_ipv(pdp, true)))
+   in46a_ntop(>addr, buf6, sizeof(buf6));
+
gsna2in_addr(, >gsnrc);

-   LOGPDPX(DGGSN, LOGL_DEBUG, pdp, "%s %s v%u TEID %"PRIx64" EUA=%s 
SGSN=%s\n", prefix,
+   LOGPDPX(DGGSN, LOGL_DEBUG, pdp, "%s %s v%u TEID %"PRIx64" EUA=(%s,%s) 
SGSN=%s\n", prefix,
devname, pdp->version,
pdp->version == 0 ? pdp_gettid(pdp->imsi, pdp->nsapi) : 
pdp->teid_gn,
-   in46a_ntoa(), inet_ntoa(ia));
+   buf4, buf6, inet_ntoa(ia));
 }

 static struct {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15251
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I7e164f40f50de43027bcd4464aa879450d2fb10e
Gerrit-Change-Number: 15251
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: ggsn_vty.c: Improve output of VTY show pdp-context

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15256 )

Change subject: ggsn_vty.c: Improve output of VTY show pdp-context
..

ggsn_vty.c: Improve output of VTY show pdp-context

GTP version and primary/secondary information is printed now for each
pdp context.

Related: OS#4154
Change-Id: If9682fe343e9a1e78175a12538fb80d4bda54802
---
M ggsn/ggsn_vty.c
1 file changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index a649173..5684f5a 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -757,6 +757,20 @@
vty_out(vty, "IMSI: %s, NSAPI: %u, MSISDN: %s%s", 
imsi_gtp2str(>imsi), pdp->nsapi,
rc ? "(NONE)" : name_buf, VTY_NEWLINE);

+   vty_out(vty, " Version: %d", pdp->version);
+   if (pdp->version == 1) {
+   if (!pdp->secondary) {
+   vty_out(vty, ", Primary, Num Secondaries: %d%s%s",
+   pdp_count_secondary(pdp) - 1, /* primary 
included in count */
+   pdp->nodata ? ", No User Plane": "",
+   VTY_NEWLINE);
+   } else {
+   vty_out(vty, ", Secondary%s", VTY_NEWLINE);
+   }
+   } else {
+   vty_out(vty, "%s", VTY_NEWLINE);
+   }
+
vty_out(vty, " Control: %s:%08x ", print_gsnaddr(>gsnlc), 
pdp->teic_own);
vty_out(vty, "<-> %s:%08x%s", print_gsnaddr(>gsnrc), pdp->teic_gn, 
VTY_NEWLINE);


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15256
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: If9682fe343e9a1e78175a12538fb80d4bda54802
Gerrit-Change-Number: 15256
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: Introduce LOGTUN log helper

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15252 )

Change subject: Introduce LOGTUN log helper
..

Introduce LOGTUN log helper

Change-Id: I237acdee0be19498804e0d509c610f4e0454ba72
---
M ggsn/ggsn.c
M ggsn/ggsn.h
2 files changed, 8 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 4e13151..94f47e3 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -556,7 +556,7 @@
pool = apn->v6.pool;
break;
default:
-   LOGP(DTUN, LOGL_NOTICE, "non-IPv%u packet received from tun\n", 
iph->version);
+   LOGTUN(LOGL_NOTICE, tun, "non-IPv%u packet received\n", 
iph->version);
return -1;
}

@@ -564,15 +564,15 @@
if (!pool)
return 0;

-   DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, 
tun->devname);
-
if (ippool_getip(pool, , )) {
-   DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ?
+   LOGTUN(LOGL_DEBUG, tun, "Received packet for APN(%s) with no 
PDP contex! (%s)\n",
+   apn->cfg.name,
+   iph->version == 4 ?
inet_ntop(AF_INET, >saddr, straddr, 
sizeof(straddr)) :
inet_ntop(AF_INET6, >ip6_src, straddr, 
sizeof(straddr)));
return 0;
}
-   DEBUGPC(DTUN, "\n");
+   LOGTUN(LOGL_DEBUG, tun, "Received packet for APN(%s)\n", apn->cfg.name);

if (ipm->peer)  /* Check if a peer protocol is defined */
gtp_data_req(apn->ggsn->gsn, (struct pdp_t *)ipm->peer, pack, 
len);
diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h
index 88fd8b9..6155b30 100644
--- a/ggsn/ggsn.h
+++ b/ggsn/ggsn.h
@@ -153,3 +153,6 @@
LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args)

 #define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## 
args)
+
+#define LOGTUN(level, tun, fmt, args...) \
+   LOGP(DTUN, level, "TUN(%s): " fmt, (tun)->devname, ## args)

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15252
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I237acdee0be19498804e0d509c610f4e0454ba72
Gerrit-Change-Number: 15252
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: doc: Update vty reference xml file

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15275 )

Change subject: doc: Update vty reference xml file
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15275
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I49e7db4d0f5c7868b86a4947d8b5739c2068da46
Gerrit-Change-Number: 15275
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:27:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: doc: Update vty reference xml file

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15275 )

Change subject: doc: Update vty reference xml file
..

doc: Update vty reference xml file

Change-Id: I49e7db4d0f5c7868b86a4947d8b5739c2068da46
---
M doc/manuals/vty/ggsn_vty_reference.xml
1 file changed, 70 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  osmith: Looks good to me, approved



diff --git a/doc/manuals/vty/ggsn_vty_reference.xml 
b/doc/manuals/vty/ggsn_vty_reference.xml
index a395b23..15128ed 100644
--- a/doc/manuals/vty/ggsn_vty_reference.xml
+++ b/doc/manuals/vty/ggsn_vty_reference.xml
@@ -254,6 +254,41 @@
 
   
 
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
 
   
 
@@ -614,6 +649,41 @@
 
   
 
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
 
   
 

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15275
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I49e7db4d0f5c7868b86a4947d8b5739c2068da46
Gerrit-Change-Number: 15275
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: ggsn_vty.c: Improve output of VTY show pdp-context

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15256 )

Change subject: ggsn_vty.c: Improve output of VTY show pdp-context
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15256
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: If9682fe343e9a1e78175a12538fb80d4bda54802
Gerrit-Change-Number: 15256
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:27:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: ggsn: Split application lifecycle related code into ggsn_main.c

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15249 )

Change subject: ggsn: Split application lifecycle related code into ggsn_main.c
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15249
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I9e6a3beac7657f0a8c02d514b54c6f1caa93bba7
Gerrit-Change-Number: 15249
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:26:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: ggsn_vty.c: Fix wrong use of in46a_from_eua, print IPv6 euas

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15248 )

Change subject: ggsn_vty.c: Fix wrong use of in46a_from_eua, print IPv6 euas
..

ggsn_vty.c: Fix wrong use of in46a_from_eua, print IPv6 euas

in46a_from_eua() API documentation clearly states an array of 2 items
should be passed as pointer, but show_one_pdp() was passing only one,
which would end up in out-of-bounds writes on v4v6 EUAs.

Let's better use ippool to print allocated ip addresses instead of
parsing EUAs we sent some point in the past.

Related OS#4154
Change-Id: Ia34939957bb7856388cb52a741cec0c015a08c70
---
M ggsn/ggsn_vty.c
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn_vty.c b/ggsn/ggsn_vty.c
index eb7cca7..0a86f49 100644
--- a/ggsn/ggsn_vty.c
+++ b/ggsn/ggsn_vty.c
@@ -734,7 +734,7 @@

 static void show_one_pdp(struct vty *vty, struct pdp_t *pdp)
 {
-   struct in46_addr eua46;
+   struct ippoolm_t *peer;
char name_buf[256];
char *apn_name;
int rc;
@@ -757,8 +757,12 @@
apn_name = osmo_apn_to_str(name_buf, pdp->apn_use.v, pdp->apn_use.l);
vty_out(vty, " APN in use: %s%s", apn_name ? name_buf : "(NONE)", 
VTY_NEWLINE);

-   in46a_from_eua(>eua, );
-   vty_out(vty, " End-User Address: %s%s", in46a_ntoa(), 
VTY_NEWLINE);
+   if ((peer = pdp_get_peer_ipv(pdp, false)))
+   vty_out(vty, " End-User Address (IPv4): %s%s",
+   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
+   if ((peer = pdp_get_peer_ipv(pdp, true)))
+   vty_out(vty, " End-User Address (IPv6): %s%s",
+   in46a_ntop(>addr, name_buf, sizeof(name_buf)), 
VTY_NEWLINE);
vty_out(vty, " Transmit GTP Sequence Number for G-PDU: %s%s",
pdp->tx_gpdu_seq ? "Yes" : "No", VTY_NEWLINE);
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15248
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ia34939957bb7856388cb52a741cec0c015a08c70
Gerrit-Change-Number: 15248
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: in46_addr: Improve in46a_ntop documentation

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15247 )

Change subject: in46_addr: Improve in46a_ntop documentation
..

in46_addr: Improve in46a_ntop documentation

Change-Id: I27238c330f9b805ac9e734e735d2c7ae158fe524
---
M lib/in46_addr.c
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  laforge: Looks good to me, approved



diff --git a/lib/in46_addr.c b/lib/in46_addr.c
index f4bb8a2..2562c71 100644
--- a/lib/in46_addr.c
+++ b/lib/in46_addr.c
@@ -60,7 +60,11 @@
return 0;
 }

-/*! Convenience wrapper around inet_ntop() for \ref in46_addr */
+/*! Convenience wrapper around inet_ntop() for in46_addr.
+ *  \param[in] in the in46_addr to print
+ *  \param[out] dst destination buffer where string representation of the 
address is stored
+ *  \param[out] dst_size size dst. Usually it should be at least 
INET6_ADDRSTRLEN.
+ *  \return address of dst on success, NULL on error */
 const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t 
dst_size)
 {
int af;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15247
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I27238c330f9b805ac9e734e735d2c7ae158fe524
Gerrit-Change-Number: 15247
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: Introduce in46a_is_v{4,6}() helpers

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15245 )

Change subject: Introduce in46a_is_v{4,6}() helpers
..

Introduce in46a_is_v{4,6}() helpers

It's clearer having size-related checks in one place for a data structure
in46_addr, instead of spread around the code.

Change-Id: Idc94bf0c8c01bb5a30e36d3c284b99f66b972abb
---
M ggsn/ggsn.c
M lib/in46_addr.h
2 files changed, 16 insertions(+), 12 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index d71855d..99eae75 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -482,19 +482,15 @@
  *  \returns The selected peer matching the given IP version. NULL if not 
present.
  */
 static struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) {
-   uint8_t len1, len2, i;
-
-   if (is_ipv6) {
-   len1 = 8;
-   len2 = 16;
-   } else {
-   len1 = sizeof(struct in_addr);
-   len2 = len1;
-   }
+   uint8_t i;

for (i = 0; i < 2; i++) {
struct ippoolm_t * ippool = pdp->peer[i];
-   if (ippool && (ippool->addr.len == len1 || ippool->addr.len == 
len2))
+   if (!ippool)
+   continue;
+   if (is_ipv6 && in46a_is_v6(>addr))
+   return ippool;
+   else if (!is_ipv6 && in46a_is_v4(>addr))
return ippool;
}
return NULL;
@@ -798,7 +794,7 @@

/* Allocate dynamic addresses from the pool */
for (i = 0; i < num_addr; i++) {
-   if (addr[i].len == sizeof(struct in_addr)) {
+   if (in46a_is_v4([i])) {
/* does this APN actually have an IPv4 pool? */
if (!apn_supports_ipv4(apn))
goto err_wrong_af;
@@ -811,7 +807,7 @@

addrv4 = member;

-   } else if (addr[i].len == sizeof(struct in6_addr)) {
+   } else if (in46a_is_v6([i])) {

/* does this APN actually have an IPv6 pool? */
if (!apn_supports_ipv6(apn))
diff --git a/lib/in46_addr.h b/lib/in46_addr.h
index e4654cc..153df00 100644
--- a/lib/in46_addr.h
+++ b/lib/in46_addr.h
@@ -31,3 +31,11 @@

 int in46a_to_eua(const struct in46_addr *src, unsigned int size, struct ul66_t 
*eua);
 int in46a_from_eua(const struct ul66_t *eua, struct in46_addr *dst);
+
+static inline bool in46a_is_v6(const struct in46_addr *addr) {
+   return addr->len == 8 || addr->len == 16;
+}
+
+static inline bool in46a_is_v4(const struct in46_addr *addr) {
+   return addr->len == sizeof(struct in_addr);
+}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15245
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Idc94bf0c8c01bb5a30e36d3c284b99f66b972abb
Gerrit-Change-Number: 15245
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-ggsn[master]: in46_addr: Improve in46a_ntop documentation

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15247 )

Change subject: in46_addr: Improve in46a_ntop documentation
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15247
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I27238c330f9b805ac9e734e735d2c7ae158fe524
Gerrit-Change-Number: 15247
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:26:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: ggsn: Move PCO handling code into its own file

2019-08-28 Thread laforge
laforge has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15246 )

Change subject: ggsn: Move PCO handling code into its own file
..

ggsn: Move PCO handling code into its own file

This way ggsn.c is shrinked in size and get rid of a lot of code there,
which is of no interest unless the reader is interested in that really
specific part.

Change-Id: Ieaa7e71f17c7fd9377c76ef53362eab596d669a6
---
M ggsn/Makefile.am
M ggsn/ggsn.c
M ggsn/ggsn.h
A ggsn/pco.c
A ggsn/pco.h
5 files changed, 343 insertions(+), 312 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index eca385f..022cdef 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -12,4 +12,4 @@
 endif

 osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
-osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h icmpv6.c icmpv6.h checksum.c 
checksum.h
+osmo_ggsn_SOURCES = ggsn_vty.c ggsn.c ggsn.h icmpv6.c icmpv6.h checksum.c 
checksum.h pco.c pco.h
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 99eae75..3c702c2 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -68,6 +68,7 @@
 #include "../gtp/pdp.h"
 #include "../gtp/gtp.h"
 #include "icmpv6.h"
+#include "pco.h"
 #include "ggsn.h"

 void *tall_ggsn_ctx;
@@ -79,14 +80,6 @@
 struct ul255_t qos;
 struct ul255_t apn;

-#define LOGPAPN(level, apn, fmt, args...)  \
-   LOGP(DGGSN, level, "APN(%s): " fmt, (apn)->cfg.name, ## args)
-
-#define LOGPGGSN(level, ggsn, fmt, args...)\
-   LOGP(DGGSN, level, "GGSN(%s): " fmt, (ggsn)->cfg.name, ## args)
-
-#define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DGGSN, level, pdp, fmt, ## 
args)
-
 static int ggsn_tun_fd_cb(struct osmo_fd *fd, unsigned int what);
 static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len);

@@ -396,92 +389,12 @@
return 0;
 }

-#include 
-
-/* RFC 1332 */
-enum ipcp_options {
-   IPCP_OPT_IPADDR = 3,
-   IPCP_OPT_PRIMARY_DNS = 129,
-   IPCP_OPT_SECONDARY_DNS = 131,
-};
-
-struct ipcp_option_hdr {
-   uint8_t type;
-   uint8_t len;
-   uint8_t data[0];
-} __attribute__ ((packed));
-
-struct ipcp_hdr {
-   uint8_t code;
-   uint8_t id;
-   uint16_t len;
-   uint8_t options[0];
-} __attribute__ ((packed));
-
-/* determine if IPCP contains given option */
-static const uint8_t *ipcp_contains_option(const struct ipcp_hdr *ipcp, size_t 
ipcp_len,
-  enum ipcp_options opt, size_t 
opt_minlen)
-{
-   const uint8_t *cur_opt = ipcp->options;
-
-   /* iterate over Options and check if protocol contained */
-   while (cur_opt + sizeof(struct ipcp_option_hdr) <= (uint8_t*)ipcp + 
ipcp_len) {
-   const struct ipcp_option_hdr *cur_opt_hdr = (const struct 
ipcp_option_hdr *)cur_opt;
-   /* length value includes 2 bytes type/length */
-   if (cur_opt_hdr->len < sizeof(struct ipcp_option_hdr))
-   return NULL;
-   if (cur_opt_hdr->type == opt &&
-   cur_opt_hdr->len >= sizeof(struct ipcp_option_hdr) + 
opt_minlen)
-   return cur_opt;
-   cur_opt += cur_opt_hdr->len;
-   }
-   return NULL;
-}
-
-/* 3GPP TS 24.008 10.6.5.3 */
-enum pco_protocols {
-   PCO_P_LCP   = 0xC021,
-   PCO_P_PAP   = 0xC023,
-   PCO_P_CHAP  = 0xC223,
-   PCO_P_IPCP  = 0x8021,
-   PCO_P_PCSCF_ADDR= 0x0001,
-   PCO_P_IM_CN_SS_F= 0x0002,
-   PCO_P_DNS_IPv6_ADDR = 0x0003,
-   PCO_P_POLICY_CTRL_REJ   = 0x0004,   /* only in Network->MS */
-   PCO_P_MS_SUP_NETREQ_BCI = 0x0005,
-   /* reserved */
-   PCO_P_DSMIPv6_HA_ADDR   = 0x0007,
-   PCO_P_DSMIPv6_HN_PREF   = 0x0008,
-   PCO_P_DSMIPv6_v4_HA_ADDR= 0x0009,
-   PCO_P_IP_ADDR_VIA_NAS   = 0x000a,   /* only MS->Network */
-   PCO_P_IPv4_ADDR_VIA_DHCP= 0x000b,   /* only MS->Netowrk */
-   PCO_P_PCSCF_IPv4_ADDR   = 0x000c,
-   PCO_P_DNS_IPv4_ADDR = 0x000d,
-   PCO_P_MSISDN= 0x000e,
-   PCO_P_IFOM_SUPPORT  = 0x000f,
-   PCO_P_IPv4_LINK_MTU = 0x0010,
-   PCO_P_MS_SUPP_LOC_A_TFT = 0x0011,
-   PCO_P_PCSCF_RESEL_SUP   = 0x0012,   /* only MS->Network */
-   PCO_P_NBIFOM_REQ= 0x0013,
-   PCO_P_NBIFOM_MODE   = 0x0014,
-   PCO_P_NONIP_LINK_MTU= 0x0015,
-   PCO_P_APN_RATE_CTRL_SUP = 0x0016,
-   PCO_P_PS_DATA_OFF_UE= 0x0017,
-   PCO_P_REL_DATA_SVC  = 0x0018,
-};
-
-struct pco_element {
-   uint16_t protocol_id;   /* network byte order */
-   uint8_t length; /* length of data below */
-   uint8_t data[0];
-} __attribute__((packed));
-
 /*! Get the peer of pdp based on IP version used.
  

Change in ...osmo-ggsn[master]: ggsn: Move PCO handling code into its own file

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15246 )

Change subject: ggsn: Move PCO handling code into its own file
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15246
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ieaa7e71f17c7fd9377c76ef53362eab596d669a6
Gerrit-Change-Number: 15246
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:26:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: Introduce in46a_is_v{4,6}() helpers

2019-08-28 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15245 )

Change subject: Introduce in46a_is_v{4,6}() helpers
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15245
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Idc94bf0c8c01bb5a30e36d3c284b99f66b972abb
Gerrit-Change-Number: 15245
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 05:25:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Build failure of network:osmocom:latest/osmo-trx in Debian_Testing/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-trx/Debian_Testing/x86_64

Package network:osmocom:latest/osmo-trx failed to build in Debian_Testing/x86_64

Check out the package for editing:
  osc checkout network:osmocom:latest osmo-trx

Last lines of build log:
[  414s] ar: `u' modifier ignored since `D' is the default (see `U')
[  414s] libtool: link: ranlib .libs/libtransceiver_common.a
[  414s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  414s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  415s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  415s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  415s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  415s] collect2: error: ld returned 1 exit status
[  415s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  415s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  415s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  415s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  415s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  415s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  415s] make[1]: *** [Makefile:444: all] Error 2
[  415s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  415s] dh_auto_build: make -j1 returned exit code 2
[  415s] make: *** [debian/rules:6: build] Error 255
[  415s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  415s] 
[  415s] lamb18 failed "build osmo-trx_1.1.1.dsc" at Thu Aug 29 04:06:50 UTC 
2019.
[  415s] 
[  415s] ### VM INTERACTION START ###
[  418s] [  398.502285] sysrq: SysRq : Power Off
[  418s] [  398.527845] reboot: Power down
[  418s] ### VM INTERACTION END ###
[  418s] 
[  418s] lamb18 failed "build osmo-trx_1.1.1.dsc" at Thu Aug 29 04:06:54 UTC 
2019.
[  418s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in ...libosmo-sccp[master]: osmo_sccp_simple_client(): use sccp instance index 0 instead of 1

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15062 )

Change subject: osmo_sccp_simple_client(): use sccp instance index 0 instead of 
1
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15062
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I9d9f6b9cdc1e3c697c8b834528d51878e1ae
Gerrit-Change-Number: 15062
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 04:05:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Build failure of network:osmocom:latest/osmo-trx in Debian_Unstable/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-trx/Debian_Unstable/x86_64

Package network:osmocom:latest/osmo-trx failed to build in 
Debian_Unstable/x86_64

Check out the package for editing:
  osc checkout network:osmocom:latest osmo-trx

Last lines of build log:
[  574s] ar: `u' modifier ignored since `D' is the default (see `U')
[  574s] libtool: link: ranlib .libs/libtransceiver_common.a
[  574s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  574s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  575s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  575s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  575s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  575s] collect2: error: ld returned 1 exit status
[  575s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  575s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  575s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  575s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  575s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  575s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  575s] make[1]: *** [Makefile:444: all] Error 2
[  575s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  575s] dh_auto_build: make -j1 returned exit code 2
[  575s] make: *** [debian/rules:6: build] Error 255
[  575s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  575s] 
[  575s] cloud115 failed "build osmo-trx_1.1.1.dsc" at Thu Aug 29 04:01:35 UTC 
2019.
[  575s] 
[  575s] ### VM INTERACTION START ###
[  578s] [  521.945920] sysrq: SysRq : Power Off
[  578s] [  521.949543] reboot: Power down
[  580s] ### VM INTERACTION END ###
[  580s] 
[  580s] cloud115 failed "build osmo-trx_1.1.1.dsc" at Thu Aug 29 04:01:40 UTC 
2019.
[  580s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/osmo-trx in Debian_Testing/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_Testing/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in 
Debian_Testing/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  421s] ar: `u' modifier ignored since `D' is the default (see `U')
[  421s] libtool: link: ranlib .libs/libtransceiver_common.a
[  421s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  421s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  421s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  422s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  422s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  422s] collect2: error: ld returned 1 exit status
[  422s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  422s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  422s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  422s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  422s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  422s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  422s] make[1]: *** [Makefile:444: all] Error 2
[  422s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  422s] dh_auto_build: make -j1 returned exit code 2
[  422s] make: *** [debian/rules:6: build] Error 255
[  422s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  422s] 
[  422s] lamb09 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Thu Aug 29 
04:00:28 UTC 2019.
[  422s] 
[  422s] ### VM INTERACTION START ###
[  425s] [  405.729899] sysrq: SysRq : Power Off
[  425s] [  405.735474] reboot: Power down
[  425s] ### VM INTERACTION END ###
[  425s] 
[  425s] lamb09 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Thu Aug 29 
04:00:32 UTC 2019.
[  425s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in ...osmo-sip-connector[master]: avoid bogus error logs when no cmd_timer is set

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15142 )

Change subject: avoid bogus error logs when no cmd_timer is set
..


Patch Set 1:

let's put this on hold until I clarified the cause of the log message


--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15142
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I70f85a71df55ab8618ed78864cefb6fe5b26f581
Gerrit-Change-Number: 15142
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: keith 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:58:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-mgw[master]: mgcp_test: extend / rewrite test_mgcp_codec_pt_translate()

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15134 )

Change subject: mgcp_test: extend / rewrite test_mgcp_codec_pt_translate()
..

mgcp_test: extend / rewrite test_mgcp_codec_pt_translate()

Instead of manually entering codec values, use mgcp_codec_add() to populate
test conns with codecs. The idea is to better test what actually happens when
parsing SDP codec strings.

Rewrite current test_mgcp_codec_pt_translate() from procedural to a data model
with human readable stdout logging.

This prepares to enable interpreting codec strings like "FOO/8000/1" as
equivalent with "FOO/8000": the SDP standard defines the final "/1", indicating
the nr of channels, as optional for a single channel, but osmo-mgw currently is
unable to match these two formats as identical. So prepare the
test_mgcp_codec_pt_translate() so that upcoming patches can incorporate strings
with and without the final "/1" by extending the struct arrays.

Change-Id: I888000d77512cfecb0f199b86ef6003e7fc0e6cb
---
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
2 files changed, 204 insertions(+), 86 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 39fe5d0..2c1e690 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1711,98 +1711,178 @@
OSMO_ASSERT(check_local_cx_options(ctx, ",,,") == -1);
 }

-static void test_mgcp_codec_pt_translate_pars(struct mgcp_rtp_codec *c)
-{
-   c->rate = 8000;
-   c->channels = 1;
-   c->frame_duration_num = 23;
-   c->frame_duration_den = 42;
-}
+static const struct mgcp_codec_param amr_param_octet_aligned_true = {
+   .amr_octet_aligned_present = true,
+   .amr_octet_aligned = true,
+};
+
+#if 0
+static const struct mgcp_codec_param amr_param_octet_aligned_false = {
+   .amr_octet_aligned_present = true,
+   .amr_octet_aligned = false,
+};
+
+static const struct mgcp_codec_param amr_param_octet_aligned_unset = {
+   .amr_octet_aligned_present = false,
+};
+#endif
+
+struct testcase_mgcp_codec_pt_translate_codec {
+   int payload_type;
+   const char *audio_name;
+   const struct mgcp_codec_param *param;
+   int expect_rc;
+};
+
+struct testcase_mgcp_codec_pt_translate_expect {
+   bool end;
+   int payload_type_map[2];
+};
+
+struct testcase_mgcp_codec_pt_translate {
+   const char *descr;
+   /* two conns on an endpoint, each with N configured codecs */
+   struct testcase_mgcp_codec_pt_translate_codec codecs[2][10];
+   struct testcase_mgcp_codec_pt_translate_expect expect[32];
+};
+
+static const struct testcase_mgcp_codec_pt_translate 
test_mgcp_codec_pt_translate_cases[] = {
+   {
+   .descr = "same order, but differing payload type numbers",
+   .codecs = {
+   {
+   { 112, "AMR/8000/1", 
_param_octet_aligned_true, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 111, "GSM-HR-08/8000/1", NULL, },
+   },
+   {
+   { 96, "AMR/8000/1", 
_param_octet_aligned_true, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 97, "GSM-HR-08/8000/1", NULL, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {112, 96}, },
+   { .payload_type_map = {0, 0}, },
+   { .payload_type_map = {111, 97} },
+   { .payload_type_map = {123, -EINVAL} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "conn0 has no codecs",
+   .codecs = {
+   {
+   /* no codecs */
+   },
+   {
+   { 96, "AMR/8000/1", 
_param_octet_aligned_true, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 97, "GSM-HR-08/8000/1", NULL, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {112, -EINVAL}, },
+   { .payload_type_map = {0, -EINVAL}, },
+   { .payload_type_map = {111, -EINVAL} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "conn1 has no codecs",
+   .codecs = {
+   {
+   { 112, "AMR/8000/1", 
_param_octet_aligned_true, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 111, "GSM-HR-08/8000/1", NULL, },
+

Change in ...osmo-mgw[master]: test_mgcp_codec_pt_translate(): more tests

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15135 )

Change subject: test_mgcp_codec_pt_translate(): more tests
..

test_mgcp_codec_pt_translate(): more tests

Change-Id: I334a075ac2800ae4a7c4e2d6eaeb17dd8c6b09a1
---
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
2 files changed, 76 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 2c1e690..460ea9b 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1770,6 +1770,49 @@
},
},
{
+   .descr = "different order and different payload type numbers",
+   .codecs = {
+   {
+   { 0, "PCMU/8000/1", NULL, },
+   { 111, "GSM-HR-08/8000/1", NULL, },
+   { 112, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   {
+   { 97, "GSM-HR-08/8000/1", NULL, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 96, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {112, 96}, },
+   { .payload_type_map = {0, 0}, },
+   { .payload_type_map = {111, 97} },
+   { .payload_type_map = {123, -EINVAL} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "both sides have the same payload_type numbers 
assigned to differing codecs",
+   .codecs = {
+   {
+   { 0, "PCMU/8000/1", NULL, },
+   { 96, "GSM-HR-08/8000/1", NULL, },
+   { 97, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   {
+   { 97, "GSM-HR-08/8000/1", NULL, },
+   { 0, "PCMU/8000/1", NULL, },
+   { 96, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {96, 97}, },
+   { .payload_type_map = {97, 96}, },
+   { .payload_type_map = {0, 0}, },
+   { .end = true },
+   },
+   },
+   {
.descr = "conn0 has no codecs",
.codecs = {
{
diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok
index 677cdc8..708e0c3 100644
--- a/tests/mgcp/mgcp_test.ok
+++ b/tests/mgcp/mgcp_test.ok
@@ -1235,7 +1235,38 @@
  - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
  - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
  - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
-#1: conn0 has no codecs
+#1: different order and different payload type numbers
+ - add codecs on conn0:
+0:   0 PCMU/8000/1  -> rc=0
+1: 111 GSM-HR-08/8000/1  -> rc=0
+2: 112 AMR/8000/1 octet-aligned=1  -> rc=0
+ - add codecs on conn1:
+0:  97 GSM-HR-08/8000/1  -> rc=0
+1:   0 PCMU/8000/1  -> rc=0
+2:  96 AMR/8000/1 octet-aligned=1  -> rc=0
+ - mgcp_codec_pt_translate(conn0, conn1, 112) -> 96
+ - mgcp_codec_pt_translate(conn1, conn0, 96) -> 112
+ - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
+ - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
+ - mgcp_codec_pt_translate(conn0, conn1, 111) -> 97
+ - mgcp_codec_pt_translate(conn1, conn0, 97) -> 111
+ - mgcp_codec_pt_translate(conn0, conn1, 123) -> -22
+#2: both sides have the same payload_type numbers assigned to differing codecs
+ - add codecs on conn0:
+0:   0 PCMU/8000/1  -> rc=0
+1:  96 GSM-HR-08/8000/1  -> rc=0
+2:  97 AMR/8000/1 octet-aligned=1  -> rc=0
+ - add codecs on conn1:
+0:  97 GSM-HR-08/8000/1  -> rc=0
+1:   0 PCMU/8000/1  -> rc=0
+2:  96 AMR/8000/1 octet-aligned=1  -> rc=0
+ - mgcp_codec_pt_translate(conn0, conn1, 96) -> 97
+ - mgcp_codec_pt_translate(conn1, conn0, 97) -> 96
+ - mgcp_codec_pt_translate(conn0, conn1, 97) -> 96
+ - mgcp_codec_pt_translate(conn1, conn0, 96) -> 97
+ - mgcp_codec_pt_translate(conn0, conn1, 0) -> 0
+ - mgcp_codec_pt_translate(conn1, conn0, 0) -> 0
+#3: conn0 has no codecs
  - add codecs on conn0:
 (none)
  - add codecs on conn1:
@@ -1245,7 +1276,7 @@
  - mgcp_codec_pt_translate(conn0, conn1, 112) -> -22
  - mgcp_codec_pt_translate(conn0, conn1, 0) -> -22
  - mgcp_codec_pt_translate(conn0, conn1, 111) -> -22
-#2: conn1 has no codecs
+#4: conn1 has no codecs
  - add codecs on conn0:
 0: 112 AMR/8000/1 octet-aligned=1  -> rc=0

Change in ...osmo-mgw[master]: SDP: store all ptmap entries

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15141 )

Change subject: SDP: store all ptmap entries
..

SDP: store all ptmap entries

If a ptmap appears in the SDP, always store it in the ptmap array. No longer
attempt to drop entries if they match the conventional payload type number.

- One reason is that the past code only matched full explicit "FOO/8000/1"
  strings, while the channel number "/1" can be omitted to imply 1; by simply
  storing everything received in the SDP, there is no need to add complexity
  to match both "FOO/8000" and "FOO/8000/1".

- The other reason is to rather parse exactly what was received, instead of
  filtering entries, to take away a degree of implied magic.

Change-Id: I2a69c21e68c602daf804744212d335ab1eafd81b
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 8 insertions(+), 20 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve



diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 6275385..5823e2b 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -337,7 +337,7 @@
 {
unsigned int pt;
char codec_resp[64];
-   unsigned int codec;
+   enum mgcp_codecs codec;

 #define A_PTIME "a=ptime:"
 #define A_RTPMAP "a=rtpmap:"
@@ -354,26 +354,14 @@
 "Failed to parse SDP parameter, invalid rtpmap: 
%s\n", osmo_quote_str(line, -1));
return -EINVAL;
}
-   /* The MGW may assign an own payload type in the
-* response if the choosen codec falls into the IANA
-* assigned dynamic payload type range (96-127).
-* Normally the MGW should obey the 3gpp payload type
-* assignments, which are fixed, so we likely wont see
-* anything unexpected here. In order to be sure that
-* we will now check the codec string and if the result
-* does not match to what is IANA / 3gpp assigned, we
-* will create an entry in the ptmap table so we can
-* lookup later what has been assigned. */
-   codec = map_str_to_codec(codec_resp);
-   if (codec != pt) {
-   if (r->ptmap_len >= ARRAY_SIZE(r->ptmap)) {
-   LOGP(DLMGCP, LOGL_ERROR, "No more space in 
ptmap array (len=%u)\n", r->ptmap_len);
-   return -ENOSPC;
-   }
-   r->ptmap[r->ptmap_len].pt = pt;
-   r->ptmap[r->ptmap_len].codec = codec;
-   r->ptmap_len++;
+   if (r->ptmap_len >= ARRAY_SIZE(r->ptmap)) {
+   LOGP(DLMGCP, LOGL_ERROR, "No more space in ptmap array 
(len=%u)\n", r->ptmap_len);
+   return -ENOSPC;
}
+   codec = map_str_to_codec(codec_resp);
+   r->ptmap[r->ptmap_len].pt = pt;
+   r->ptmap[r->ptmap_len].codec = codec;
+   r->ptmap_len++;
}

return 0;

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15141
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I2a69c21e68c602daf804744212d335ab1eafd81b
Gerrit-Change-Number: 15141
Gerrit-PatchSet: 5
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-mgw[master]: tweak mgcp_parse_audio_ptime_rtpmap()

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15140 )

Change subject: tweak mgcp_parse_audio_ptime_rtpmap()
..

tweak mgcp_parse_audio_ptime_rtpmap()

- move the error logging up to the actual errors. Each appear only once, no
  goto labels needed.

- instead of strstr("rtpmap"), use osmo_str_startswith("a=rtpmap:") to more
  concisely trigger on the actual syntax of the audio parameters. Same for
  "a=ptime:".

Change-Id: I730111e245da8485c1b5e8811f75d140e379cec6
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 33 insertions(+), 35 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index 3f8e780..6275385 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -339,46 +339,44 @@
char codec_resp[64];
unsigned int codec;

+#define A_PTIME "a=ptime:"
+#define A_RTPMAP "a=rtpmap:"

-   if (strstr(line, "ptime")) {
-   if (sscanf(line, "a=ptime:%u", >ptime) != 1)
-   goto response_parse_failure_ptime;
-   } else if (strstr(line, "rtpmap")) {
-   if (sscanf(line, "a=rtpmap:%d %63s", , codec_resp) == 2) {
-   /* The MGW may assign an own payload type in the
-* response if the choosen codec falls into the IANA
-* assigned dynamic payload type range (96-127).
-* Normally the MGW should obey the 3gpp payload type
-* assignments, which are fixed, so we likely wont see
-* anything unexpected here. In order to be sure that
-* we will now check the codec string and if the result
-* does not match to what is IANA / 3gpp assigned, we
-* will create an entry in the ptmap table so we can
-* lookup later what has been assigned. */
-   codec = map_str_to_codec(codec_resp);
-   if (codec != pt) {
-   if (r->ptmap_len < ARRAY_SIZE(r->ptmap)) {
-   r->ptmap[r->ptmap_len].pt = pt;
-   r->ptmap[r->ptmap_len].codec = codec;
-   r->ptmap_len++;
-   } else
-   goto response_parse_failure_rtpmap;
+   if (osmo_str_startswith(line, A_PTIME)) {
+   if (sscanf(line, A_PTIME "%u", >ptime) != 1) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"Failed to parse SDP parameter, invalid ptime 
(%s)\n", line);
+   return -EINVAL;
+   }
+   } else if (osmo_str_startswith(line, A_RTPMAP)) {
+   if (sscanf(line, A_RTPMAP "%d %63s", , codec_resp) != 2) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"Failed to parse SDP parameter, invalid rtpmap: 
%s\n", osmo_quote_str(line, -1));
+   return -EINVAL;
+   }
+   /* The MGW may assign an own payload type in the
+* response if the choosen codec falls into the IANA
+* assigned dynamic payload type range (96-127).
+* Normally the MGW should obey the 3gpp payload type
+* assignments, which are fixed, so we likely wont see
+* anything unexpected here. In order to be sure that
+* we will now check the codec string and if the result
+* does not match to what is IANA / 3gpp assigned, we
+* will create an entry in the ptmap table so we can
+* lookup later what has been assigned. */
+   codec = map_str_to_codec(codec_resp);
+   if (codec != pt) {
+   if (r->ptmap_len >= ARRAY_SIZE(r->ptmap)) {
+   LOGP(DLMGCP, LOGL_ERROR, "No more space in 
ptmap array (len=%u)\n", r->ptmap_len);
+   return -ENOSPC;
}
-
-   } else
-   goto response_parse_failure_rtpmap;
+   r->ptmap[r->ptmap_len].pt = pt;
+   r->ptmap[r->ptmap_len].codec = codec;
+   r->ptmap_len++;
+   }
}

return 0;
-
-response_parse_failure_ptime:
-   LOGP(DLMGCP, LOGL_ERROR,
-"Failed to parse SDP parameter, invalid ptime (%s)\n", line);
-   return -EINVAL;
-response_parse_failure_rtpmap:
-   LOGP(DLMGCP, LOGL_ERROR,
-"Failed to parse SDP parameter, invalid rtpmap (%s)\n", line);
-  

Change in ...osmo-mgw[master]: mgcp_codec: codec_set(): log about all possible errors

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15138 )

Change subject: mgcp_codec: codec_set(): log about all possible errors
..

mgcp_codec: codec_set(): log about all possible errors

In codec_set(), for each 'goto error', log the specific error cause.

Also add a TODO and a FIXME comment about inventing dynamic payload type
numbers.

Change-Id: I0b44b574c814882b6f8ae7cd738a6f481cd721fd
---
M src/libosmo-mgcp/mgcp_codec.c
1 file changed, 25 insertions(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 7c8f6d5..704b7e6 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -138,12 +138,13 @@
if (payload_type != PTYPE_UNDEFINED) {
/* Make sure we do not get any reserved or undefined type 
numbers */
/* See also: 
https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml */
-   if (payload_type == 1 || payload_type == 2 || payload_type == 
19)
+   if ((payload_type == 1 || payload_type == 2 || payload_type == 
19)
+   || (payload_type >= 72 && payload_type <= 76)
+   || (payload_type >= 127)) {
+   LOGP(DLMGCP, LOGL_ERROR, "Cannot add codec, payload 
type number %d is reserved\n",
+payload_type);
goto error;
-   if (payload_type >= 72 && payload_type <= 76)
-   goto error;
-   if (payload_type >= 127)
-   goto error;
+   }

codec->payload_type = payload_type;
}
@@ -169,6 +170,8 @@
/* The given payload type is not known to us, or it
 * it is a dynamic payload type for which we do not
 * know the audio name. We must give up here */
+   LOGP(DLMGCP, LOGL_ERROR, "No audio codec name given, 
and payload type %d unknown\n",
+payload_type);
goto error;
}
}
@@ -176,16 +179,23 @@
/* Now we extract the codec subtype name, rate and channels. The latter
 * two are optional. If they are not present we use the safe defaults
 * above. */
-   if (strlen(audio_name) > sizeof(audio_codec))
+   if (strlen(audio_name) > sizeof(audio_codec)) {
+   LOGP(DLMGCP, LOGL_ERROR, "Audio codec too long: %s\n", 
osmo_quote_str(audio_name, -1));
goto error;
+   }
channels = DEFAULT_RTP_AUDIO_DEFAULT_CHANNELS;
rate = DEFAULT_RTP_AUDIO_DEFAULT_RATE;
-   if (sscanf(audio_name, "%63[^/]/%d/%d", audio_codec, , ) 
< 1)
+   if (sscanf(audio_name, "%63[^/]/%d/%d", audio_codec, , ) 
< 1) {
+   LOGP(DLMGCP, LOGL_ERROR, "Invalid audio codec: %s\n", 
osmo_quote_str(audio_name, -1));
goto error;
+   }

/* Note: We only accept configurations with one audio channel! */
-   if (channels != 1)
+   if (channels != 1) {
+   LOGP(DLMGCP, LOGL_ERROR, "Cannot handle audio codec with more 
than one channel: %s\n",
+osmo_quote_str(audio_name, -1));
goto error;
+   }

codec->rate = rate;
codec->channels = channels;
@@ -203,6 +213,7 @@

/* Derive the payload type if it is unknown */
if (codec->payload_type == PTYPE_UNDEFINED) {
+   /* TODO: This is semi dead code, see OS#4150 */

/* For the known codecs from the static range we restore
 * the IANA or 3GPP assigned payload type number */
@@ -238,9 +249,14 @@
 * 110 onwards 3gpp defines prefered codec types, which are
 * also fixed, see above)  */
if (codec->payload_type < 0) {
+   /* FIXME: pt_offset is completely unrelated and useless 
here, any of those numbers may already
+* have been added to the codecs. Instead, there should 
be an iterator checking for an actually
+* unused dynamic payload type number. */
codec->payload_type = 96 + pt_offset;
-   if (codec->payload_type > 109)
+   if (codec->payload_type > 109) {
+   LOGP(DLMGCP, LOGL_ERROR, "Ran out of payload 
type numbers to assign dynamically\n");
goto error;
+   }
}
}


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15138
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw

Change in ...osmo-mgw[master]: ptmap: implicitly match '/8000' and '/8000/1'

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15137 )

Change subject: ptmap: implicitly match  '/8000' and '/8000/1'
..

ptmap: implicitly match  '/8000' and '/8000/1'

In codecs_same(), do not compare the complete audio_name. The parts of it are
already checked individually:
- subtype_name ("AMR"),
- rate ("8000"; defaults to 8000 if omitted) and
- channels ("1"; defaults to 1 if omitted)
So by also checking the complete audio_name, we brushed over the match of
implicit "/8000" and "/8000/1", which otherwise works out fine.

As a result, translating payload type numbers in RTP headers now also works if
one conn of an endpoint set an rtpmap with "AMR/8000" and the other conn set
"AMR/8000/1".

It seems to me that most PBX out there generate ptmaps omitting the "/1", so
fixing this should make us more interoperable with third party SDP.

See IETF RFC4566 section 6. SDP Attributes:
  For audio streams,  indicates the number
  of audio channels.  This parameter is OPTIONAL and may be
  omitted if the number of channels is one, provided that no
  additional parameters are needed.

Also allowing to omit the "/8000" is a mere side effect of this patch.
Omitting the rate does not seem to be specified in an RFC, but is logical for
audio codecs defined to require exactly 8000 set as rate (most GSM codecs).

Add tests in mgcp_test.c.

Change-Id: Iab00bf9a55b1847f85999077114b37e70fb677c2
---
M src/libosmo-mgcp/mgcp_codec.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 108 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 5d7f840..7c8f6d5 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -379,8 +379,6 @@
return false;
if (codec_a->frame_duration_den != codec_b->frame_duration_den)
return false;
-   if (strcmp(codec_a->audio_name, codec_b->audio_name))
-   return false;
if (strcmp(codec_a->subtype_name, codec_b->subtype_name))
return false;
if (!strcmp(codec_a->subtype_name, "AMR")) {
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 5ebe475..e5dec2a 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1900,6 +1900,70 @@
{ .end = true },
},
},
+   {
+   .descr = "match FOO/8000/1 and FOO/8000 as identical, single 
channel is implicit",
+   .codecs = {
+   {
+   { 0, "PCMU/8000/1", NULL, },
+   { 111, "GSM-HR-08/8000/1", NULL, },
+   { 112, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   {
+   { 97, "GSM-HR-08/8000", NULL, },
+   { 0, "PCMU/8000", NULL, },
+   { 96, "AMR/8000", 
_param_octet_aligned_true, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {112, 96}, },
+   { .payload_type_map = {0, 0}, },
+   { .payload_type_map = {111, 97} },
+   { .payload_type_map = {123, -EINVAL} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "match FOO/8000/1 and FOO as identical, 8k and single 
channel are implicit",
+   .codecs = {
+   {
+   { 0, "PCMU/8000/1", NULL, },
+   { 111, "GSM-HR-08/8000/1", NULL, },
+   { 112, "AMR/8000/1", 
_param_octet_aligned_true, },
+   },
+   {
+   { 97, "GSM-HR-08", NULL, },
+   { 0, "PCMU", NULL, },
+   { 96, "AMR", _param_octet_aligned_true, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {112, 96}, },
+   { .payload_type_map = {0, 0}, },
+   { .payload_type_map = {111, 97} },
+   { .payload_type_map = {123, -EINVAL} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "test whether channel number matching is waterproof",
+   .codecs = {
+   {
+   { 111, "GSM-HR-08/8000", },
+   { 112, "GSM-HR-08/8000/2", .expect_rc = -22},
+   { 113, "GSM-HR-08/8000/3", .expect_rc = -22},
+   

Change in ...osmo-mgw[master]: differentiate AMR octet-aligned=0 vs =1

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15136 )

Change subject: differentiate AMR octet-aligned=0 vs =1
..

differentiate AMR octet-aligned=0 vs =1

Add corresponding tests in mgcp_test.c

Change-Id: Ib8be73a7ca1b95ce794d130e8eb206dcee700124
---
M src/libosmo-mgcp/mgcp_codec.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 104 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved
  keith: Looks good to me, but someone else must approve



diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 7f1a6d1..5d7f840 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -348,6 +348,25 @@
return -EINVAL;
 }

+/* Return true if octet-aligned is set in the given codec. Default to 
octet-aligned=0, i.e. bandwidth-efficient mode.
+ * See RFC4867 "RTP Payload Format for AMR and AMR-WB" sections "8.1. AMR 
Media Type Registration" and "8.2. AMR-WB
+ * Media Type Registration":
+ *
+ *octet-align: Permissible values are 0 and 1.  If 1, octet-aligned
+ * operation SHALL be used.  If 0 or if not present,
+ * bandwidth-efficient operation is employed.
+ *
+ * https://tools.ietf.org/html/rfc4867
+ */
+static bool amr_is_octet_aligned(const struct mgcp_rtp_codec *codec)
+{
+   if (!codec->param_present)
+   return false;
+   if (!codec->param.amr_octet_aligned_present)
+   return false;
+   return codec->param.amr_octet_aligned;
+}
+
 /* Compare two codecs, all parameters must match up, except for the payload 
type
  * number. */
 static bool codecs_same(struct mgcp_rtp_codec *codec_a, struct mgcp_rtp_codec 
*codec_b)
@@ -364,6 +383,10 @@
return false;
if (strcmp(codec_a->subtype_name, codec_b->subtype_name))
return false;
+   if (!strcmp(codec_a->subtype_name, "AMR")) {
+   if (amr_is_octet_aligned(codec_a) != 
amr_is_octet_aligned(codec_b))
+   return false;
+   }

return true;
 }
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 460ea9b..5ebe475 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1716,7 +1716,6 @@
.amr_octet_aligned = true,
 };

-#if 0
 static const struct mgcp_codec_param amr_param_octet_aligned_false = {
.amr_octet_aligned_present = true,
.amr_octet_aligned = false,
@@ -1725,7 +1724,6 @@
 static const struct mgcp_codec_param amr_param_octet_aligned_unset = {
.amr_octet_aligned_present = false,
 };
-#endif

 struct testcase_mgcp_codec_pt_translate_codec {
int payload_type;
@@ -1850,6 +1848,58 @@
{ .end = true },
},
},
+   {
+   .descr = "test AMR with differing octet-aligned settings",
+   .codecs = {
+   {
+   { 111, "AMR/8000", 
_param_octet_aligned_true, },
+   { 112, "AMR/8000", 
_param_octet_aligned_false, },
+   },
+   {
+   { 122, "AMR/8000", 
_param_octet_aligned_false, },
+   { 121, "AMR/8000", 
_param_octet_aligned_true, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {111, 121}, },
+   { .payload_type_map = {112, 122} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "test AMR with missing octet-aligned settings 
(defaults to 0)",
+   .codecs = {
+   {
+   { 111, "AMR/8000", 
_param_octet_aligned_true, },
+   { 112, "AMR/8000", 
_param_octet_aligned_false, },
+   },
+   {
+   { 122, "AMR/8000", 
_param_octet_aligned_unset, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {111, -EINVAL}, },
+   { .payload_type_map = {112, 122} },
+   { .end = true },
+   },
+   },
+   {
+   .descr = "test AMR with NULL param (defaults to 0)",
+   .codecs = {
+   {
+   { 111, "AMR/8000", 
_param_octet_aligned_true, },
+   { 112, "AMR/8000", 
_param_octet_aligned_false, },
+   },
+   {
+   { 122, "AMR/8000", NULL, },
+   },
+   },
+   .expect = {
+   { .payload_type_map = {111, -EINVAL}, },
+   { 

Change in ...osmo-mgw[master]: mgcp_codec_add: fix audio_name size check

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15301 )

Change subject: mgcp_codec_add: fix audio_name size check
..

mgcp_codec_add: fix audio_name size check

Needs to account for terminating '\0'.

Change-Id: I27896beef6ffcc1cb6207daaba6c8b2b03eb513d
---
M src/libosmo-mgcp/mgcp_codec.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c
index 704b7e6..9e55ab0 100644
--- a/src/libosmo-mgcp/mgcp_codec.c
+++ b/src/libosmo-mgcp/mgcp_codec.c
@@ -179,7 +179,7 @@
/* Now we extract the codec subtype name, rate and channels. The latter
 * two are optional. If they are not present we use the safe defaults
 * above. */
-   if (strlen(audio_name) > sizeof(audio_codec)) {
+   if (strlen(audio_name) >= sizeof(audio_codec)) {
LOGP(DLMGCP, LOGL_ERROR, "Audio codec too long: %s\n", 
osmo_quote_str(audio_name, -1));
goto error;
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15301
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I27896beef6ffcc1cb6207daaba6c8b2b03eb513d
Gerrit-Change-Number: 15301
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-mgw[master]: explicitly free codecs in mgcp_rtp_conn_cleanup()

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/15139 )

Change subject: explicitly free codecs in mgcp_rtp_conn_cleanup()
..

explicitly free codecs in mgcp_rtp_conn_cleanup()

There are allocated bits in conn->end.codecs[], free them.

This is not fixing a memleak, since mgcp_rtp_conn_cleanup() is currently only
called from mgcp_conn_free(), which soon after frees the conn; the conn serves
as talloc parent for the codec strings freed in this patch.

The rationale: it is better style to explicitly free them, to also guard
against future callers of mgcp_rtp_conn_cleanup() which might expect complete
cleanup.

Change-Id: Ic471107ce6e94d9ce582d887429c744ff93e3053
---
M src/libosmo-mgcp/mgcp_conn.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 772584b..60a1700 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -129,6 +129,7 @@
conn_osmux_disable(conn_rtp);
mgcp_free_rtp_port(_rtp->end);
rate_ctr_group_free(conn_rtp->rate_ctr_group);
+   mgcp_codec_reset_all(conn_rtp);
 }

 void mgcp_conn_watchdog_cb(void *data)

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15139
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic471107ce6e94d9ce582d887429c744ff93e3053
Gerrit-Change-Number: 15139
Gerrit-PatchSet: 5
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in ...osmo-sip-connector[master]: mncc: do not unregister unregistered osmo fds

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303 )

Change subject: mncc: do not unregister unregistered osmo fds
..


Patch Set 2: Code-Review-1

(1 comment)

plz explain...

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c
File src/mncc.c:

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c@329
PS2, Line 329:  close(conn->fd.fd);
I'm also wondering. Have you seen a scenario where an unregistered fd was 
unregistered again? Would that mean that close_connection() was called twice 
and this function should exit if the fd is not registered?



--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Gerrit-Change-Number: 15303
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:55:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Build failure of network:osmocom:nightly/osmo-trx in Debian_Unstable/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_Unstable/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in 
Debian_Unstable/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  330s] ar: `u' modifier ignored since `D' is the default (see `U')
[  330s] libtool: link: ranlib .libs/libtransceiver_common.a
[  330s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  330s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  330s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  330s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  330s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  330s] collect2: error: ld returned 1 exit status
[  330s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  330s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  331s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  331s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  331s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  331s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  331s] make[1]: *** [Makefile:444: all] Error 2
[  331s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  331s] dh_auto_build: make -j1 returned exit code 2
[  331s] make: *** [debian/rules:6: build] Error 255
[  331s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  331s] 
[  331s] sheep82 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Thu Aug 29 
03:54:32 UTC 2019.
[  331s] 
[  331s] ### VM INTERACTION START ###
[  334s] [  321.386962] sysrq: SysRq : Power Off
[  334s] [  321.393013] reboot: Power down
[  334s] ### VM INTERACTION END ###
[  334s] 
[  334s] sheep82 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Thu Aug 29 
03:54:36 UTC 2019.
[  334s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in ...osmo-ggsn[master]: gtp: Log msg retransmits and timeouts

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15305 )

Change subject: gtp: Log msg retransmits and timeouts
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/15305/1/gtp/gtp.c
File gtp/gtp.c:

https://gerrit.osmocom.org/#/c/15305/1/gtp/gtp.c@604
PS1, Line 604:   qmsg->seq);
(line width of 120?)
(so far we just use '%u' for all kinds of unsigned types <= unsigned int, and 
it seems to work fine?)



--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15305
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie768ddb45313582b4b5358b97a981080be64fd42
Gerrit-Change-Number: 15305
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:47:52 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ggsn[master]: cosmetic: fix formatting in if line

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15302 )

Change subject: cosmetic: fix formatting in if line
..


Patch Set 1: Code-Review+1

(1 comment)

not really worth the trouble, but whatever

https://gerrit.osmocom.org/#/c/15302/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/15302/1//COMMIT_MSG@10
PS1, Line 10: Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6
AFAIK the'Fixes:' tag should reference an issue number. I'd rather say 
"Introduced in eefa...".



--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15302
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I9ee5f4142cacf912145693c72a53c0f531bad2c6
Gerrit-Change-Number: 15302
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:45:30 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_echo_timeout

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15306 )

Change subject: sgsn: Introduce test TC_attach_echo_timeout
..


Patch Set 1: Code-Review+1

(1 comment)

I don't fully comprehend but looks sane enough

https://gerrit.osmocom.org/#/c/15306/1/sgsn/SGSN_Tests.ttcn
File sgsn/SGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/15306/1/sgsn/SGSN_Tests.ttcn@1562
PS1, Line 1562:should drop the pdp ctx. Around T3 (3secs) * 6 (+ 
extra, a lot due to OS#4178): */
maybe could f_vty_transceive() to configure a shorter timeout? (to get a 
shorter test run)



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15306
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic31748924e7bf05ea2ccf2b1be0c460eefed5782
Gerrit-Change-Number: 15306
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:41:17 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-ttcn3-hacks[master]: sgsn: Proper shutdown of RAN_Adapter components

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15295 )

Change subject: sgsn: Proper shutdown of RAN_Adapter components
..


Patch Set 2: Code-Review+1

I don't fully understand, but looks sane to me


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15295
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I471eb851e5d41de5d8d974ec81be27024d7d313a
Gerrit-Change-Number: 15295
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:36:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...pysim[master]: Make programming OPC optional

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/15311 )

Change subject: Make programming OPC optional
..


Patch Set 1: Code-Review+1

I was kind of expecting a cmdline switch to go along with this?


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
Gerrit-Change-Number: 15311
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:34:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...pysim[master]: make writing SMSP optional

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/15312 )

Change subject: make writing SMSP optional
..


Patch Set 1: Code-Review+1

I was kind of expecting a cmdline switch to go along with this?


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
Gerrit-Change-Number: 15312
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:34:21 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: gsm_08_08.c: always pick first msc for unsolicit paging responses

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/15209 )

Change subject: gsm_08_08.c: always pick first msc for unsolicit paging 
responses
..


Patch Set 2: Code-Review+1

(1 comment)

Even if multiple MSC were still a use case, it makes sense to send to the first 
one by default. If the user wanted to configure a different MSC as Paging 
Response target, she could just rearrange the ordering.

https://gerrit.osmocom.org/#/c/15209/2/src/osmo-bsc/gsm_08_08.c
File src/osmo-bsc/gsm_08_08.c:

https://gerrit.osmocom.org/#/c/15209/2/src/osmo-bsc/gsm_08_08.c@327
PS2, Line 327:  goto blind;
lol "go blind"



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Gerrit-Change-Number: 15209
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: neels 
Gerrit-CC: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Thu, 29 Aug 2019 03:31:30 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-msc[master]: log, cosmetic: add "RR" to "Ciphering Mode Complete"

2019-08-28 Thread neels
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-msc/+/15318

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

Change subject: log, cosmetic: add "RR" to "Ciphering Mode Complete"
..

log, cosmetic: add "RR" to "Ciphering Mode Complete"

Distinguish the enclosed DTAP RR Ciphering Mode Complete message from the outer
BSSMAP Cipher Mode Complete message in the DEBUG log.

Change-Id: I80c69b491e2ddb932bc4295a01caaf6a903b1fe4
---
M src/libmsc/gsm_04_08.c
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/18/15318/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15318
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I80c69b491e2ddb932bc4295a01caaf6a903b1fe4
Gerrit-Change-Number: 15318
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-msc[master]: fix error on BSSMAP Cipher Mode Complete L3 msg IE

2019-08-28 Thread neels
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-msc/+/15317

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

Change subject: fix error on BSSMAP Cipher Mode Complete L3 msg IE
..

fix error on BSSMAP Cipher Mode Complete L3 msg IE

When an MS returns the IMEISV in the BSSMAP Cipher Mode Complete message in
the Layer 3 Message Contents IE, do not re-invoke the decode_cb() a second
time, but instead point to it from the ran_msg.cipher_mode_complete struct.

When the MSC-A decodes the Ciphering Mode Complete message, it always wants to
also decode the enclosed DTAP from the Layer 3 Message Contents IE. However,
when the MSC-I preliminarily decodes messages, it often just wants to identify
specific messages without fully acting on them, let alone dispatching RAN_UP_L2
events more than once. So leave it up to the supplied decode_cb passed to
ran_dec_l2() implementations to decide whether to decode the DTAP.

In msc_a.c hence evaluate the DTAP by passing a non-allocated msgb instance to
msc_a_up_l3(), which will evaluate the RR Ciphering Mode Complete message found
in the BSSMAP Cipher Mode Complete's Layer 3 Message Contents IE.

Particularly, the previous choice of calling the decode_cb a second time for
the enclosed DTAP caused a header/length parsing error: the second decode_cb
call tried to mimick DTAP by overwriting the l3h pointer and truncating the
length of the msgb, but subsequently ran_a_decode_l2() would again derive the
l3h from the l2h, obliterating the intended re-interpretation as DTAP, and
hence the previous truncation caused error messages on each and every Cipher
Mode Complete message, like:

DBSSAP ERROR libmsc/ran_msg_a.c:764 
msc_a(IMSI-26242340300:MSISDN-:TMSI-0xA73E055A:GERAN-A-77923:LU)[0x5563947521e0]{MSC_A_ST_AUTH_CIPH}:
 RAN decode: BSSMAP: BSSMAP data truncated, discarding message

This error was seen a lot at CCCamp2019.

Modifying the msgb was a bad idea to begin with, the approach taken in this
patch is much cleaner.

Note that apparently many phones include the IMEISV in the Cipher Mode Complete
message even though the BSSMAP Cipher Mode Command did not include the Cipher
Response Mode IE. So, even though we did not specifically ask for the Cipher
Mode Complete to include any identity, many MS default to including the IMEISV
of their own accord. Reproduce: attach to osmo-msc with ciphering enabled using
a Samsung Galaxy S4mini.

Related: OS#4168
Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
---
M include/osmocom/msc/ran_msg.h
M src/libmsc/msc_a.c
M src/libmsc/ran_msg_a.c
3 files changed, 22 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/15317/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15317
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
Gerrit-Change-Number: 15317
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-msc[master]: cc trans: make sure bearer cap is empty

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15320


Change subject: cc trans: make sure bearer cap is empty
..

cc trans: make sure bearer cap is empty

Change-Id: I147f10f9258fc8685f2f666878dd2a655b8e4583
---
M src/libmsc/transaction.c
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index ebdaced..11cde93 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -147,6 +147,10 @@
.transaction_id = trans_id,
.callref = callref,
.net = net,
+   /* empty bearer_cap: make sure the speech_ver array is empty */
+   .bearer_cap = {
+   .speech_ver = { -1 },
+   },
};
vlr_subscr_get(vsub, trans_vsub_use(type));
llist_add_tail(>entry, >trans_list);

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15320
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I147f10f9258fc8685f2f666878dd2a655b8e4583
Gerrit-Change-Number: 15320
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in ...osmo-msc[master]: memleak on cc setup errors

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15319


Change subject: memleak on cc setup errors
..

memleak on cc setup errors

Change-Id: Ib90064575b270627721ace7e07d085f4ad43
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 2 insertions(+), 0 deletions(-)



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

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index f974e90..a1fea9a 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -598,6 +598,7 @@
  GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
trans->callref = 0;
trans_free(trans);
+   msgb_free(msg);
return rc;
}

@@ -610,6 +611,7 @@
  GSM48_CC_CAUSE_RESOURCE_UNAVAIL);
trans->callref = 0;
trans_free(trans);
+   msgb_free(msg);
return rc;
}
trans->transaction_id = trans_id;

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15319
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ib90064575b270627721ace7e07d085f4ad43
Gerrit-Change-Number: 15319
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Build failure of network:osmocom:latest/osmo-trx in Debian_Unstable/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-trx/Debian_Unstable/x86_64

Package network:osmocom:latest/osmo-trx failed to build in 
Debian_Unstable/x86_64

Check out the package for editing:
  osc checkout network:osmocom:latest osmo-trx

Last lines of build log:
[  521s] ar: `u' modifier ignored since `D' is the default (see `U')
[  521s] libtool: link: ranlib .libs/libtransceiver_common.a
[  522s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  522s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  522s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  522s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  522s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  522s] collect2: error: ld returned 1 exit status
[  522s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  522s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  522s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  522s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  522s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  522s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  522s] make[1]: *** [Makefile:444: all] Error 2
[  522s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  522s] dh_auto_build: make -j1 returned exit code 2
[  522s] make: *** [debian/rules:6: build] Error 255
[  522s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  522s] 
[  522s] lamb05 failed "build osmo-trx_1.1.1.dsc" at Wed Aug 28 23:16:00 UTC 
2019.
[  522s] 
[  522s] ### VM INTERACTION START ###
[  525s] [  507.083353] sysrq: SysRq : Power Off
[  525s] [  507.088780] reboot: Power down
[  525s] ### VM INTERACTION END ###
[  525s] 
[  525s] lamb05 failed "build osmo-trx_1.1.1.dsc" at Wed Aug 28 23:16:03 UTC 
2019.
[  525s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/osmo-trx in Debian_Unstable/x86_64

2019-08-28 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_Unstable/x86_64

Package network:osmocom:nightly/osmo-trx failed to build in 
Debian_Unstable/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-trx

Last lines of build log:
[  331s] ar: `u' modifier ignored since `D' is the default (see `U')
[  331s] libtool: link: ranlib .libs/libtransceiver_common.a
[  331s] libtool: link: ( cd ".libs" && rm -f "libtransceiver_common.la" && ln 
-s "../libtransceiver_common.la" "libtransceiver_common.la" )
[  331s] /bin/bash ../libtool  --tag=CXX   --mode=link g++ -lpthread 
-I/usr/include/ -I/usr/include/ -I/usr/include/ -g -O2 
-fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat 
-Werror=format-security  -Wl,-z,relro -Wl,-z,now -o osmo-trx-uhd 
osmo_trx_uhd-osmo-trx.o ./device/uhd/libdevice.la libtransceiver_common.la 
../Transceiver52M/arch/x86/libarch.la ../GSM/libGSM.la 
../CommonLibs/libcommon.la -lfftw3f -ltalloc -losmocore -ltalloc -losmoctrl 
-losmogsm -losmocore -ltalloc -losmovty -losmocore -luhd 
[  331s] libtool: link: g++ -I/usr/include/ -I/usr/include/ -I/usr/include/ -g 
-O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong 
-Wformat -Werror=format-security -Wl,-z -Wl,relro -Wl,-z -Wl,now -o 
osmo-trx-uhd osmo_trx_uhd-osmo-trx.o  ./device/uhd/.libs/libdevice.a 
./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a 
../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -lpthread -lfftw3f 
/usr/lib/x86_64-linux-gnu/libosmoctrl.so 
/usr/lib/x86_64-linux-gnu/libosmogsm.so -ltalloc 
/usr/lib/x86_64-linux-gnu/libosmovty.so 
/usr/lib/x86_64-linux-gnu/libosmocore.so -luhd
[  331s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o): undefined 
reference to symbol '_ZN5boost6system16generic_categoryEv'
[  331s] /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_system.so.1.67.0: 
error adding symbols: DSO missing from command line
[  331s] collect2: error: ld returned 1 exit status
[  332s] make[4]: *** [Makefile:681: osmo-trx-uhd] Error 1
[  332s] make[4]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  332s] make[3]: *** [Makefile:820: all-recursive] Error 1
[  332s] make[3]: Leaving directory '/usr/src/packages/BUILD/Transceiver52M'
[  332s] make[2]: *** [Makefile:513: all-recursive] Error 1
[  332s] make[2]: Leaving directory '/usr/src/packages/BUILD'
[  332s] make[1]: *** [Makefile:444: all] Error 2
[  332s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  332s] dh_auto_build: make -j1 returned exit code 2
[  332s] make: *** [debian/rules:6: build] Error 255
[  332s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  332s] 
[  332s] sheep83 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Wed Aug 28 
23:07:29 UTC 2019.
[  332s] 
[  332s] ### VM INTERACTION START ###
[  335s] [  321.962951] sysrq: SysRq : Power Off
[  335s] [  321.969205] reboot: Power down
[  335s] ### VM INTERACTION END ###
[  335s] 
[  335s] sheep83 failed "build osmo-trx_1.1.1.10.77f3.dsc" at Wed Aug 28 
23:07:33 UTC 2019.
[  335s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in ...osmo-msc[master]: log, cosmetic: add "RR" to "Ciphering Mode Complete"

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15318


Change subject: log, cosmetic: add "RR" to "Ciphering Mode Complete"
..

log, cosmetic: add "RR" to "Ciphering Mode Complete"

Distinguish the enclosed DTAP RR Ciphering Mode Complete message from the outer
BSSMAP Cipher Mode Complete message in the DEBUG log.

Change-Id: I80c69b491e2ddb932bc4295a01caaf6a903b1fe4
---
M src/libmsc/gsm_04_08.c
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
2 files changed, 2 insertions(+), 2 deletions(-)



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

diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 086116f..0bdc4fb 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1185,7 +1185,7 @@
if (!mi)
return 0;

-   LOG_MSC_A(msc_a, LOGL_DEBUG, "Ciphering Mode Complete contains Mobile 
Identity: %s\n",
+   LOG_MSC_A(msc_a, LOGL_DEBUG, "RR Ciphering Mode Complete contains 
Mobile Identity: %s\n",
  osmo_mi_name(mi->val, mi->len));

if (!vsub)
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err 
b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 893203e..89455de 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -1785,7 +1785,7 @@
 DVLR upd_hlr_vlr_fsm(IMSI-90170004620:GERAN-A:LU){UPD_HLR_VLR_S_INIT}: 
state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA
 DBSSAP msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: RAN decode: 
DTAP
 DRLL msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: Dispatching 
04.08 message: RR GSM48_MT_RR_CIPH_M_COMPL
-DBSSAP msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: Ciphering 
Mode Complete contains Mobile Identity: IMEI-SV-4234234234234275F
+DBSSAP msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: RR 
Ciphering Mode Complete contains Mobile Identity: IMEI-SV-4234234234234275F
 DVLR set IMEISV on subscriber; IMSI=90170004620 IMEISV=4234234234234275
 DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=42342342342342
 DVLR vlr_lu_fsm(IMSI-90170004620:GERAN-A:LU){VLR_ULA_S_WAIT_HLR_UPD}: 
Received Event VLR_ULA_E_ID_IMEISV

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15318
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I80c69b491e2ddb932bc4295a01caaf6a903b1fe4
Gerrit-Change-Number: 15318
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in ...osmo-msc[master]: fix error on Ciphering Mode Complete L3 IE decoding

2019-08-28 Thread neels
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-msc/+/15317

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

Change subject: fix error on Ciphering Mode Complete L3 IE decoding
..

fix error on Ciphering Mode Complete L3 IE decoding

When an MS returns the IMEISV in the BSSMAP Ciphering Mode Complete message in
the Layer 3 Message Contents IE, do not re-invoke the decode_cb() a second
time, but instead point to it from the ran_msg.cipher_mode_complete struct.

When the MSC-A decodes the Ciphering Mode Complete message, it always wants to
also decode the enclosed DTAP from the Layer 3 Message Contents IE. However,
when the MSC-I preliminarily decodes messages, it often just wants to identify
specific messages without fully acting on them, let alone dispatching RAN_UP_L2
events more than once. So leave it up to the supplied decode_cb passed to
ran_dec_l2() implementations to decide whether to decode the DTAP.

In msc_a.c hence evaluate the DTAP by passing a non-allocated msgb instance to
msc_a_up_l3(), which will evaluate the RR Ciphering Mode Complete message found
in the BSSMAP Ciphering Mode Complete's Layer 3 Message Contents IE.

Particularly, the previous choice of calling the decode_cb a second time for
the enclosed DTAP caused a header/length parsing error: the second decode_cb
call tried to mimick DTAP by overwriting the l3h pointer and truncating the
length of the msgb, but subsequently ran_a_decode_l2() would again derive the
l3h from the l2h, obliterating the intended re-interpretation as DTAP, and
hence the previous truncation caused error messages on each and every Ciphering
Mode Complete message, like:

DBSSAP ERROR libmsc/ran_msg_a.c:764 
msc_a(IMSI-26242340300:MSISDN-:TMSI-0xA73E055A:GERAN-A-77923:LU)[0x5563947521e0]{MSC_A_ST_AUTH_CIPH}:
 RAN decode: BSSMAP: BSSMAP data truncated, discarding message

This error was seen a lot at CCCamp2019.

Modifying the msgb was a bad idea to begin with, the approach taken in this
patch is much cleaner.

Note that apparently many phones include the IMEISV in the Cipher Mode Complete
message even though the BSSMAP Cipher Mode Command did not include the Cipher
Response Mode IE. So, even though we did not specifically ask for the Cipher
Mode Complete to include any identity, many MS default to including the IMEISV
of their own accord. Reproduce: attach to osmo-msc with Ciphering enabled using
a Samsung Galaxy S4mini.

Related: OS#4168
Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
---
M include/osmocom/msc/ran_msg.h
M src/libmsc/msc_a.c
M src/libmsc/ran_msg_a.c
3 files changed, 22 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/15317/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15317
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
Gerrit-Change-Number: 15317
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-msc[master]: fix error on Ciphering Mode Complete L3 IE decoding

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15317


Change subject: fix error on Ciphering Mode Complete L3 IE decoding
..

fix error on Ciphering Mode Complete L3 IE decoding

When an MS returns the IMEISV in the BSSMAP Ciphering Mode Complete message in
the Layer 3 Message Contents IE, do not re-invoke the decode_cb() a second
time, but instead point to it from the ran_msg.cipher_mode_complete struct.

When the MSC-A decodes the Ciphering Mode Complete message, it always wants to
also decode the enclosed DTAP from the Layer 3 Message Contents IE. However,
when the MSC-I preliminarily decodes messages, it often just wants to identify
specific messages without fully acting on them, let alone dispatching RAN_UP_L2
events more than once. So leave it up to the supplied decode_cb passed to
ran_dec_l2() implementations to decide whether to decode the DTAP.

In msc_a.c hence evaluate the DTAP by passing a non-allocated msgb instance to
msc_a_up_l3(), which will evaluate the RR Ciphering Mode Complete message found
in the BSSMAP Ciphering Mode Complete's Layer 3 Message Contents IE.

Particularly, the previous choice of calling the decode_cb a second time for
the enclosed DTAP caused a header/length parsing error: the second decode_cb
call tried to mimick DTAP by overwriting the l3h pointer and truncating the
length of the msgb, but subsequently ran_a_decode_l2() would again derive the
l3h from the l2h, obliterating the intended re-interpretation as DTAP, and
hence the previous truncation caused error messages on each and every Ciphering
Mode Complete message, like:

DBSSAP ERROR libmsc/ran_msg_a.c:764 
msc_a(IMSI-26242340300:MSISDN-:TMSI-0xA73E055A:GERAN-A-77923:LU)[0x5563947521e0]{MSC_A_ST_AUTH_CIPH}:
 RAN decode: BSSMAP: BSSMAP data truncated, discarding message

This error was seen a lot at CCCamp2019.

Modifying the msgb was a bad idea to begin with, the approach taken in this
patch is much cleaner.

Note that apparently many phones include the IMEISV in the Cipher Mode Complete
message even though the BSSMAP Cipher Mode Command did not include the Cipher
Response Mode IE. So, even though we did not specifically ask for the Cipher
Mode Complete to include any identity, many MS default to including the IMEISV
of their own accord. Reproduce: attach to osmo-msc with Ciphering enabled using
a Samsung Galaxy S4mini.

Related: OS#4168
Change-Id: Icd8dad18d6dda24d075dd8da72c3d6db1302090d
---
M include/osmocom/msc/ran_msg.h
M src/libmsc/gsm_04_08.c
M src/libmsc/msc_a.c
M src/libmsc/ran_msg_a.c
4 files changed, 23 insertions(+), 12 deletions(-)



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

diff --git a/include/osmocom/msc/ran_msg.h b/include/osmocom/msc/ran_msg.h
index af0822b..081c7ad 100644
--- a/include/osmocom/msc/ran_msg.h
+++ b/include/osmocom/msc/ran_msg.h
@@ -210,6 +210,7 @@
 * alg_id == 0 means no such IE was present. */
uint8_t alg_id;
const char *imeisv;
+   const struct tlv_p_entry *l3_msg;
} cipher_mode_complete;
struct {
enum gsm0808_cause bssap_cause;
diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index 086116f..0bdc4fb 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -1185,7 +1185,7 @@
if (!mi)
return 0;

-   LOG_MSC_A(msc_a, LOGL_DEBUG, "Ciphering Mode Complete contains Mobile 
Identity: %s\n",
+   LOG_MSC_A(msc_a, LOGL_DEBUG, "RR Ciphering Mode Complete contains 
Mobile Identity: %s\n",
  osmo_mi_name(mi->val, mi->len));

if (!vsub)
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 553761f..44ef194 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1401,6 +1401,24 @@
};
vlr_subscr_rx_ciph_res(vsub, VLR_CIPH_COMPL);
rc = 0;
+
+   /* Evaluate enclosed L3 message, typically Identity Response 
(IMEISV) */
+   if (msg->cipher_mode_complete.l3_msg) {
+   unsigned char *data = (unsigned 
char*)(msg->cipher_mode_complete.l3_msg->val);
+   uint16_t len = msg->cipher_mode_complete.l3_msg->len;
+
+   /* All of the DTAP handling code expects a msgb 
argument pointing at the data.
+* We could allocate a separate msgb, but this static 
msgb saves the extra allocation. */
+   struct msgb dtap = {
+   .data_len = len,
+   .len = len,
+   .data = data,
+   .head = data,
+   .tail = data + len,
+   .l3h = data,
+   };
+   rc = 

Change in ...osmo-msc[master]: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15315


Change subject: vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD
..

vlr_lu_fsm: ignore ID_IMEISV during VLR_ULA_S_WAIT_HLR_UPD

Change-Id: I2ea4f46efa013671d93892cb07bf830393289150
---
M src/libvlr/vlr_lu_fsm.c
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
2 files changed, 7 insertions(+), 2 deletions(-)



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

diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c
index 454709f..2db5711 100644
--- a/src/libvlr/vlr_lu_fsm.c
+++ b/src/libvlr/vlr_lu_fsm.c
@@ -1234,6 +1234,10 @@
}
}
break;
+   case VLR_ULA_E_ID_IMEI:
+   case VLR_ULA_E_ID_IMEISV:
+   /* Got the IMEI from ME, nothing to do right now though. */
+   break;
default:
OSMO_ASSERT(0);
break;
@@ -1400,7 +1404,9 @@
},
[VLR_ULA_S_WAIT_HLR_UPD] = {
.in_event_mask = S(VLR_ULA_E_HLR_LU_RES) |
-S(VLR_ULA_E_UPD_HLR_COMPL),
+S(VLR_ULA_E_UPD_HLR_COMPL) |
+S(VLR_ULA_E_ID_IMEI) |
+S(VLR_ULA_E_ID_IMEISV),
.out_state_mask = S(VLR_ULA_S_WAIT_LU_COMPL) |
  S(VLR_ULA_S_WAIT_LU_COMPL_STANDALONE) |
  S(VLR_ULA_S_DONE),
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err 
b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
index 893203e..7b9970d 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err
@@ -1789,7 +1789,6 @@
 DVLR set IMEISV on subscriber; IMSI=90170004620 IMEISV=4234234234234275
 DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=42342342342342
 DVLR vlr_lu_fsm(IMSI-90170004620:GERAN-A:LU){VLR_ULA_S_WAIT_HLR_UPD}: 
Received Event VLR_ULA_E_ID_IMEISV
-DVLR vlr_lu_fsm(IMSI-90170004620:GERAN-A:LU){VLR_ULA_S_WAIT_HLR_UPD}: 
Event VLR_ULA_E_ID_IMEISV not permitted
 DREF msc_a(IMSI-90170004620:GERAN-A:LU){MSC_A_ST_AUTH_CIPH}: - 
ms_sends_ciphering_mode_complete: now used by 1 (lu)
   lu_result_sent == 0
 - Subscriber has the IMEISV

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15315
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I2ea4f46efa013671d93892cb07bf830393289150
Gerrit-Change-Number: 15315
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in ...osmo-msc[master]: fix segfault: don't send CC REL on NULL msc_a

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15314


Change subject: fix segfault: don't send CC REL on NULL msc_a
..

fix segfault: don't send CC REL on NULL msc_a

Apparently, if a conn disappears during an ongoing call, the CC code tried to
send a CC REL on a NULL msc_a during cleanup, which lead to a crash
(cccamp2019). Guard against that.

Crash:

 #0  msc_a_tx_dtap_to_i (msc_a=0x0, dtap=0x55a4bf2fa0f0) at 
../../../../src/osmo-msc/src/libmsc/msc_a.c:1565
 #1  0x55a4be1bb03c in trans_tx_gsm48 (trans=0x55a4bf2d52a0, 
trans=0x55a4bf2d52a0, trans=0x55a4bf2d52a0, msg=)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:82
 #2  gsm48_cc_tx_release (trans=trans@entry=0x55a4bf2d52a0, 
arg=arg@entry=0x7ffdd731a0e0) at 
../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:1101
 #3  0x55a4be1bee65 in _gsm48_cc_trans_free 
(trans=trans@entry=0x55a4bf2d52a0) at 
../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:278
 #4  0x55a4be1ab654 in trans_free (trans=trans@entry=0x55a4bf2d52a0) at 
../../../../src/osmo-msc/src/libmsc/transaction.c:170
 #5  0x55a4be1bd091 in mncc_tx_to_gsm_cc (net=, 
msg=msg@entry=0x55a4bf2d3b68)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:1971
 #6  0x55a4be1bf1e5 in mncc_tx_to_cc (net=, 
arg=arg@entry=0x55a4bf2d3b68)
 at ../../../../src/osmo-msc/src/libmsc/gsm_04_08_cc.c:2049
 #7  0x55a4be18ed63 in mncc_sock_read (bfd=0x55a4bf2563b8, 
bfd=0x55a4bf2563b8) at ../../../../src/osmo-msc/src/libmsc/mncc_sock.c:121
 #8  mncc_sock_cb (bfd=0x55a4bf2563b8, flags=1) at 
../../../../src/osmo-msc/src/libmsc/mncc_sock.c:189
 #9  0x7fcfad607ce1 in osmo_fd_disp_fds (_eset=0x7ffdd731a9a0, 
_wset=0x7ffdd731a920, _rset=0x7ffdd731a8a0)
 at ../../../src/libosmocore/src/select.c:223
 #10 osmo_select_main (polling=) at 
../../../src/libosmocore/src/select.c:263
 #11 0x55a4be17dd56 in main (argc=3, argv=) at 
../../../../src/osmo-msc/src/osmo-msc/msc_main.c:723

Change-Id: Ia1bb0410ad0618c182a5f6da06af342b6d483eff
---
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/msc_a.c
2 files changed, 19 insertions(+), 2 deletions(-)



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

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index f974e90..5217861 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1074,8 +1074,16 @@
 static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg)
 {
struct gsm_mncc *rel = arg;
-   struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL");
-   struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
+   struct msgb *msg;
+   struct gsm48_hdr *gh;
+
+   if (!trans->msc_a) {
+   LOG_TRANS(trans, LOGL_DEBUG, "Cannot send CC REL, there is no 
MSC-A connection\n");
+   return -EINVAL;
+   }
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL");
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
 
gh->msg_type = GSM48_MT_CC_RELEASE;

diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 553761f..b3e2e32 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -1562,6 +1562,15 @@
 {
struct ran_msg ran_msg;

+   if (!msc_a) {
+   struct gsm48_hdr *gh = msgb_l3(dtap) ? : dtap->data;
+   uint8_t pdisc = gsm48_hdr_pdisc(gh);
+   LOGP(DMSC, LOGL_ERROR, "Attempt to send DTAP to NULL MSC-A, 
dropping message: %s %s\n",
+gsm48_pdisc_name(pdisc), gsm48_pdisc_msgtype_name(pdisc, 
gsm48_hdr_msg_type(gh)));
+   msgb_free(dtap);
+   return -EIO;
+   }
+
if (msc_a->c.ran->type == OSMO_RAT_EUTRAN_SGS) {
/* The SGs connection to the MME always is at the MSC-A. */
return sgs_iface_tx_dtap_ud(msc_a, dtap);

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15314
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia1bb0410ad0618c182a5f6da06af342b6d483eff
Gerrit-Change-Number: 15314
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in ...osmo-msc[master]: tweak CC cause for incoming call to unattached nr

2019-08-28 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15316


Change subject: tweak CC cause for incoming call to unattached nr
..

tweak CC cause for incoming call to unattached nr

So far we sent CC cause "Unassigned Number"

But the MSC doesn't trivially know whether the HLR has the number assigned or
not: any handset that is currently switched off would cause "Unassigned number"
to be displayed on the caller's handset.

Rather send a temporary failure cause code.

Send this cause code for all cases, because claiming that an assigned number is
unassigned is worse than rejecting an unassigned number with a temporary
failure.

Change-Id: Ia3d4f67b53fcc2654ff048fbc338e92cb763a095
---
M src/libmsc/gsm_04_08_cc.c
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 5217861..c941a7a 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1890,7 +1890,7 @@
}
if (!vsub)
return mncc_release_ind(net, NULL, data->callref, 
GSM48_CAUSE_LOC_PRN_S_LU,
-   GSM48_CC_CAUSE_UNASSIGNED_NR);
+   GSM48_CC_CAUSE_USER_NOTRESPOND);
/* update the subscriber we deal with */
log_set_context(LOG_CTX_VLR_SUBSCR, vsub);


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15316
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d4f67b53fcc2654ff048fbc338e92cb763a095
Gerrit-Change-Number: 15316
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-MessageType: newchange


Change in ...osmo-msc[master]: mncc: send payload type matching chosen codec

2019-08-28 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15060 )

Change subject: mncc: send payload type matching chosen codec
..

mncc: send payload type matching chosen codec

Change-Id: Id32f32d77d24b753adb96b5393c0363439e312c2
---
M include/osmocom/msc/mncc_call.h
M src/libmsc/gsm_04_08_cc.c
2 files changed, 27 insertions(+), 12 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  keith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/include/osmocom/msc/mncc_call.h b/include/osmocom/msc/mncc_call.h
index ad0f0f8..e887cbe 100644
--- a/include/osmocom/msc/mncc_call.h
+++ b/include/osmocom/msc/mncc_call.h
@@ -22,6 +22,7 @@
  */
 #pragma once

+#include 
 #include 
 #include 

@@ -138,3 +139,5 @@
 struct mncc_call *mncc_call_find_by_callref(uint32_t callref);

 void mncc_call_release(struct mncc_call *mncc_call);
+
+uint32_t mgcp_codec_to_mncc_payload_msg_type(enum mgcp_codecs codec);
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 34d95f6..f974e90 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -30,6 +30,8 @@
 #include 
 #include 

+#include 
+
 #include 
 #include 
 #include 
@@ -1667,18 +1669,28 @@
struct gsm_network *net = msc_a_net(msc_a);
struct call_leg *cl = msc_a->cc.call_leg;
struct osmo_sockaddr_str *rtp_cn_local;
-   /* FIXME: This has to be set to some meaningful value,
-* before the MSC-Split, this value was pulled from
-* lchan->abis_ip.rtp_payload */
-   uint32_t payload_type = 0;
-   int msg_type;
+   struct rtp_stream *rtp_cn = cl ? cl->rtp[RTP_TO_CN] : NULL;
+   uint32_t payload_type;
+   int payload_msg_type;
+   const struct mgcp_conn_peer *mgcp_info;

-   /* FIXME This has to be set to some meaningful value.
-* Possible options are:
-* GSM_TCHF_FRAME, GSM_TCHF_FRAME_EFR,
-* GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR
-* (0 if unknown) */
-   msg_type = GSM_TCHF_FRAME;
+   if (!rtp_cn) {
+   LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR, "Cannot RTP CREATE to 
MNCC, no RTP set up for the CN side\n");
+   return -EINVAL;
+   }
+
+   if (!rtp_cn->codec_known) {
+   LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR,
+ "Cannot RTP CREATE to MNCC, no codec set up for 
the RTP CN side\n");
+   return -EINVAL;
+   }
+
+   /* Codec */
+   payload_msg_type = mgcp_codec_to_mncc_payload_msg_type(rtp_cn->codec);
+
+   /* Payload Type number */
+   mgcp_info = osmo_mgcpc_ep_ci_get_rtp_info(rtp_cn->ci);
+   payload_type = map_codec_to_pt(mgcp_info->ptmap, mgcp_info->ptmap_len, 
rtp_cn->codec);

rtp_cn_local = call_leg_local_ip(cl, RTP_TO_CN);
if (!rtp_cn_local) {
@@ -1686,7 +1698,7 @@
return -EINVAL;
}

-   return mncc_recv_rtp(net, trans, trans->callref, MNCC_RTP_CREATE, 
rtp_cn_local, payload_type, msg_type);
+   return mncc_recv_rtp(net, trans, trans->callref, MNCC_RTP_CREATE, 
rtp_cn_local, payload_type, payload_msg_type);
 }

 static int tch_rtp_connect(struct gsm_network *net, const struct gsm_mncc_rtp 
*rtp)

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15060
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Id32f32d77d24b753adb96b5393c0363439e312c2
Gerrit-Change-Number: 15060
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


Change in ...osmo-msc[master]: mncc: send payload type matching chosen codec

2019-08-28 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/15060 )

Change subject: mncc: send payload type matching chosen codec
..


Patch Set 2:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15060
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: Id32f32d77d24b753adb96b5393c0363439e312c2
Gerrit-Change-Number: 15060
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Wed, 28 Aug 2019 21:22:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...pysim[master]: pySim-prog: Use CSV format with headers

2019-08-28 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/15313


Change subject: pySim-prog: Use CSV format with headers
..

pySim-prog: Use CSV format with headers

This way we can have optional fields like adm1 in the file
Also require iccid as identifier for the SIM card

Change-Id: I0d317ea51d0cf582b82157eec6cdec074001a236
---
M pySim-prog.py
M pySim/cards.py
2 files changed, 22 insertions(+), 14 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/15313/1

diff --git a/pySim-prog.py b/pySim-prog.py
index 2638eef..dde9194 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -399,7 +399,7 @@
'ki': ki,
'opc'   : opc,
'acc'   : acc,
-   'pin_adm' : pin_adm,
+   'adm1' : pin_adm,
}


@@ -414,6 +414,7 @@
  > Ki  : %(ki)s
  > OPC : %(opc)s
  > ACC : %(acc)s
+ > ADM1: %(adm1)s
 """% params


@@ -427,18 +428,23 @@
cw.writerow([params[x] for x in row])
f.close()

-def _read_params_csv(opts, imsi):
+def _read_params_csv(opts, iccid=None, imsi=None):
import csv
-   row = ['name', 'iccid', 'mcc', 'mnc', 'imsi', 'smsp', 'ki', 'opc']
f = open(opts.read_csv, 'r')
-   cr = csv.DictReader(f, row)
+   cr = csv.DictReader(f)
i = 0
+if not 'iccid' in cr.fieldnames:
+raise Exception("CSV file in wrong format!")
for row in cr:
if opts.num is not None and opts.read_imsi is False:
if opts.num == i:
f.close()
return row;
i += 1
+   if row['iccid'] == iccid:
+   f.close()
+   return row;
+
if row['imsi'] == imsi:
f.close()
return row;
@@ -446,8 +452,8 @@
f.close()
return None

-def read_params_csv(opts, imsi):
-   row = _read_params_csv(opts, imsi)
+def read_params_csv(opts, imsi=None, iccid=None):
+   row = _read_params_csv(opts, iccid=iccid, imsi=imsi)
if row is not None:
row['mcc'] = int(row['mcc'])
row['mnc'] = int(row['mnc'])
@@ -628,7 +634,9 @@
if opts.source == 'cmdline':
cp = gen_parameters(opts)
elif opts.source == 'csv':
-   if opts.read_imsi:
+imsi = None
+iccid = None
+if opts.read_imsi:
if opts.dry_run:
# Connect transport
print "Insert card now (or CTRL-C to 
cancel)"
@@ -637,7 +645,7 @@
imsi = swap_nibbles(res)[3:]
else:
imsi = opts.imsi
-   cp = read_params_csv(opts, imsi)
+   cp = read_params_csv(opts, imsi=imsi, iccid=iccid)
if cp is None:
print "Error reading parameters\n"
sys.exit(2)
diff --git a/pySim/cards.py b/pySim/cards.py
index 55282aa..a850e5a 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -375,8 +375,8 @@
#self._scc.verify_chv(4, h2b(""))

# Authenticate using ADM PIN 5
-   if p['pin_adm']:
-   pin = h2b(p['pin_adm'])
+   if p['adm1']:
+   pin = h2b(p['adm1'])
else:
pin = h2b("")
self._scc.verify_chv(5, pin)
@@ -495,8 +495,8 @@
# P1: 3A for PIN, 3B for PUK
# P2: CHV number, as in VERIFY CHV for PIN, and as in UNBLOCK 
CHV for PUK
# P3: 08, CHV length (curiously the PUK is also 08 length, 
instead of 10)
-   if p['pin_adm']:
-   pin = p['pin_adm']
+   if p['adm1']:
+   pin = p['adm1']
else:
pin = h2b("")

@@ -567,9 +567,9 @@
def program(self, p):

# authenticate as ADM using default key (written on the card..)
-   if not p['pin_adm']:
+   if not p['adm1']:
raise ValueError("Please provide a PIN-ADM as there is 
no default one")
-   self._scc.verify_chv(0x0A, h2b(p['pin_adm']))
+   self._scc.verify_chv(0x0A, p['adm1'])

# select MF
r = self._scc.select_file(['3f00'])

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

Gerrit-Project: pysim
Gerrit-Branch: master

Change in ...pysim[master]: Make programming OPC optional

2019-08-28 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/15311


Change subject: Make programming OPC optional
..

Make programming OPC optional

Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
---
M pySim/cards.py
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/11/15311/1

diff --git a/pySim/cards.py b/pySim/cards.py
index a341b71..cb42d83 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -582,9 +582,9 @@
data, sw = self._scc.update_binary('00FF', p['ki'])

# set OPc in proprietary file
-   content = "01" + p['opc']
-   data, sw = self._scc.update_binary('00F7', content)
-
+   if 'opc' in p:
+   content = "01" + p['opc']
+   data, sw = self._scc.update_binary('00F7', content)

# write EF.IMSI
data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi']))

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic600c325557918cb7d5b1fb179c01936a078c96c
Gerrit-Change-Number: 15311
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in ...pysim[master]: make writing SMSP optional

2019-08-28 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/15312


Change subject: make writing SMSP optional
..

make writing SMSP optional

Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
---
M pySim/cards.py
1 file changed, 8 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/12/15312/1

diff --git a/pySim/cards.py b/pySim/cards.py
index cb42d83..55282aa 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -394,8 +394,9 @@
data, sw = self._scc.update_binary('6f78', 
lpad(p['acc'], 4))

# EF.SMSP
-   r = self._scc.select_file(['3f00', '7f10', '6f42'])
-   data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 
80))
+if p.get('smsp'):
+   r = self._scc.select_file(['3f00', '7f10', '6f42'])
+   data, sw = self._scc.update_record('6f42', 1, 
lpad(p['smsp'], 80))

# Set the Ki using proprietary command
pdu = '80d4020010' + p['ki']
@@ -535,7 +536,8 @@
r = self._scc.select_file(['3f00', '7f10'])

# write EF.SMSP
-   data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 
80))
+if p.get('smsp'):
+   data, sw = self._scc.update_record('6f42', 1, 
lpad(p['smsp'], 80))

def erase(self):
return
@@ -614,8 +616,9 @@
print("Programming AD failed with code %s"%sw)

# EF.SMSP
-   r = self._scc.select_file(['3f00', '7f10'])
-   data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 
104), force_len=True)
+   if p.get('smsp'):
+   r = self._scc.select_file(['3f00', '7f10'])
+   data, sw = self._scc.update_record('6f42', 1, 
lpad(p['smsp'], 104), force_len=True)

def erase(self):
return

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5fdd397244cfe73b5b6a12883316072cc10f7b4
Gerrit-Change-Number: 15312
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in ...osmo-ggsn[master]: ggsn, sgsnemu: Drop use of no-op deprecated gtp_retrans* APIs

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15310


Change subject: ggsn, sgsnemu: Drop use of no-op deprecated gtp_retrans* APIs
..

ggsn, sgsnemu: Drop use of no-op deprecated gtp_retrans* APIs

Related: OS#4178
Change-Id: I295b89ee493d230c2550d461fca9602c589d38b5
---
M ggsn/ggsn.c
M ggsn/ggsn.h
M sgsnemu/sgsnemu.c
3 files changed, 2 insertions(+), 34 deletions(-)



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

diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 7b32bde..27f3b51 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -739,28 +739,6 @@
return rc;
 }

-static void ggsn_gtp_tmr_start(struct ggsn_ctx *ggsn)
-{
-   struct timeval next;
-
-   /* Retrieve next retransmission as timeval */
-   gtp_retranstimeout(ggsn->gsn, );
-
-   /* re-schedule the timer */
-   osmo_timer_schedule(>gtp_timer, next.tv_sec, next.tv_usec/1000);
-}
-
-/* timer callback for libgtp retransmission and ping */
-static void ggsn_gtp_tmr_cb(void *data)
-{
-   struct ggsn_ctx *ggsn = data;
-
-   /* do all the retransmissions as needed */
-   gtp_retrans(ggsn->gsn);
-
-   ggsn_gtp_tmr_start(ggsn);
-}
-
 /* libgtp callback for confirmations */
 static int cb_conf(int type, int cause, struct pdp_t *pdp, void *cbp)
 {
@@ -847,10 +825,6 @@
rc = osmo_fd_register(>gtp_fd1u);
OSMO_ASSERT(rc == 0);

-   /* Start GTP re-transmission timer */
-   osmo_timer_setup(>gtp_timer, ggsn_gtp_tmr_cb, ggsn);
-   ggsn_gtp_tmr_start(ggsn);
-
gtp_set_cb_data_ind(ggsn->gsn, encaps_tun);
gtp_set_cb_delete_context(ggsn->gsn, delete_context);
gtp_set_cb_create_context_ind(ggsn->gsn, create_context_ind);
@@ -878,8 +852,6 @@
llist_for_each_entry(apn, >apn_list, list)
apn_stop(apn);

-   osmo_timer_del(>gtp_timer);
-
osmo_fd_unregister(>gtp_fd1u);
osmo_fd_unregister(>gtp_fd1c);
osmo_fd_unregister(>gtp_fd0);
diff --git a/ggsn/ggsn.h b/ggsn/ggsn.h
index f23df54..82984a0 100644
--- a/ggsn/ggsn.h
+++ b/ggsn/ggsn.h
@@ -138,8 +138,6 @@
struct osmo_fd gtp_fd0;
struct osmo_fd gtp_fd1c;
struct osmo_fd gtp_fd1u;
-
-   struct osmo_timer_list gtp_timer;
 };

 /* ggsn_vty.c */
diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 4f1f844..863ea51 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -1801,7 +1801,8 @@
FD_SET(gsn->fd1c, );
FD_SET(gsn->fd1u, );

-   gtp_retranstimeout(gsn, );
+   idleTime.tv_sec = 10;
+   idleTime.tv_usec = 0;
ping_timeout();

if (options.debug)
@@ -1817,9 +1818,6 @@
SYS_ERR(DSGSN, LOGL_ERROR, 0,
"Select returned -1");
break;
-   case 0:
-   gtp_retrans(gsn);   /* Only retransmit if nothing 
else */
-   break;
default:
break;
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15310
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I295b89ee493d230c2550d461fca9602c589d38b5
Gerrit-Change-Number: 15310
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-ggsn[master]: gtp: Manage queue timers internally

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15309


Change subject: gtp: Manage queue timers internally
..

gtp: Manage queue timers internally

Currently each user (application) of libgtp needs to manage its own
timers in order to call gtp_retrans_timeout() and gtp_retrans() and
maintain retransmit and duplicate queues working correctly. This adds
unnecesary complexity to applications since nowadays, as a libosmocore
user, libgtp can handle this internally in an easy way.
Furthermore, keeping the timers internal to the library allows for
easier extension of features as well as re-implementation of related
code in the future.
Last but not least, it was detected that existing known applications
(osmo-sgsn, osmo-ggsn, sgsnemu) are not using correctly the API, since
they should be updating their timers through gtp_retrans_timeout()
everytime a message is enqueued/transmitted, otherwise they may fire
gtp_retrans() for retransmition too late in some cases.

Related: OS#4178
Change-Id: Ife7cfd66d6356f413263fe5bda9e43091f5c9e98
---
M gtp/gtp.c
M gtp/gtp.h
2 files changed, 128 insertions(+), 72 deletions(-)



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

diff --git a/gtp/gtp.c b/gtp/gtp.c
index 2ea949d..66aedb8 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -386,6 +386,109 @@
}
 }

+static int queue_timer_retrans(struct gsn_t *gsn)
+{
+   /* Retransmit any outstanding packets */
+   /* Remove from queue if maxretrans exceeded */
+   time_t now;
+   struct qmsg_t *qmsg;
+   now = time(NULL);
+   /*printf("Retrans: New beginning %d\n", (int) now); */
+
+   /* get first element in queue, as long as the timeout of that
+* element has expired */
+   while ((!queue_getfirst(gsn->queue_req, )) &&
+  (qmsg->timeout <= now)) {
+   /*printf("Retrans timeout found: %d\n", (int) time(NULL)); */
+   if (qmsg->retrans > N3_REQUESTS) {  /* To many retrans */
+   LOGP(DLGTP, LOGL_NOTICE, "Timeout of seq %" PRIu16 "\n",
+qmsg->seq);
+   if (gsn->cb_conf)
+   gsn->cb_conf(qmsg->type, EOF, NULL, qmsg->cbp);
+   queue_freemsg(gsn->queue_req, qmsg);
+   } else {
+   LOGP(DLGTP, LOGL_INFO, "Retransmit (%d) of seq %" 
PRIu16 "\n",
+qmsg->retrans, qmsg->seq);
+   if (sendto(qmsg->fd, >p, qmsg->l, 0,
+  (struct sockaddr *)>peer,
+  sizeof(struct sockaddr_in)) < 0) {
+   gsn->err_sendto++;
+   LOGP(DLGTP, LOGL_ERROR,
+   "Sendto(fd0=%d, msg=%lx, len=%d) 
failed: Error = %s\n",
+   gsn->fd0, (unsigned long)>p,
+   qmsg->l, strerror(errno));
+   }
+   queue_back(gsn->queue_req, qmsg);
+   qmsg->timeout = now + T3_REQUEST;
+   qmsg->retrans++;
+   }
+   }
+
+   /* Also clean up reply timeouts */
+   while ((!queue_getfirst(gsn->queue_resp, )) &&
+  (qmsg->timeout < now)) {
+   /*printf("Retrans (reply) timeout found: %d\n", (int) 
time(NULL)); */
+   queue_freemsg(gsn->queue_resp, qmsg);
+   }
+
+   return 0;
+}
+
+static int queue_timer_retranstimeout(struct gsn_t *gsn, struct timeval 
*timeout)
+{
+   time_t now, later, diff;
+   struct qmsg_t *qmsg;
+   timeout->tv_usec = 0;
+
+   if (queue_getfirst(gsn->queue_req, )) {
+   timeout->tv_sec = 10;
+   } else {
+   now = time(NULL);
+   later = qmsg->timeout;
+   timeout->tv_sec = later - now;
+   if (timeout->tv_sec < 0)
+   timeout->tv_sec = 0;/* No negative allowed */
+   if (timeout->tv_sec > 10)
+   timeout->tv_sec = 10;   /* Max sleep for 10 sec */
+   }
+
+   if (queue_getfirst(gsn->queue_resp, )) {
+   /* already set by queue_req, do nothing */
+   } else { /* trigger faster if earlier timeout exists in queue_resp */
+   now = time(NULL);
+   later = qmsg->timeout;
+   diff = later - now;
+   if (diff < 0)
+   diff = 0;
+   if (diff < timeout->tv_sec)
+   timeout->tv_sec = diff;
+   }
+
+   return 0;
+}
+
+static void queue_timer_start(struct gsn_t *gsn)
+{
+   struct timeval next;
+
+   /* Retrieve next retransmission as timeval */
+   queue_timer_retranstimeout(gsn, );
+
+   /* re-schedule the timer */
+   

Change in ...osmo-sgsn[master]: Introduce log helper LOGGGSN

2019-08-28 Thread pespin
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-sgsn/+/15307

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

Change subject: Introduce log helper LOGGGSN
..

Introduce log helper LOGGGSN

It will be used in forthcoming commits.

Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
---
M include/osmocom/sgsn/debug.h
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/sgsn_main.c
3 files changed, 12 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
Gerrit-Change-Number: 15307
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-sgsn[master]: sgsn: gtp: Drop related pdp contexts on echo timeout against GGSN

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15308


Change subject: sgsn: gtp: Drop related pdp contexts on echo timeout against 
GGSN
..

sgsn: gtp: Drop related pdp contexts on echo timeout against GGSN

Change-Id: I7e97bac1c13a2c26203eb64e590fd75d77eb44bd
---
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/gprs_sgsn.c
M src/gprs/sgsn_libgtp.c
3 files changed, 16 insertions(+), 7 deletions(-)



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

diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 55aae86..44aeace 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -401,6 +401,7 @@
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
 void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx);
 int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct 
sgsn_pdp_ctx *except);
+int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
 void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx 
*pdp);
 void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx 
*pdp);
 void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc);
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 7174bd5..829204e 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -759,6 +759,11 @@
return num;
 }

+int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn)
+{
+   return sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, NULL);
+}
+
 void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp)
 {
llist_add(>ggsn_list, >pdp_list);
diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c
index 88b8d04..ac4b7b1 100644
--- a/src/gprs/sgsn_libgtp.c
+++ b/src/gprs/sgsn_libgtp.c
@@ -469,7 +469,8 @@

 void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc)
 {
-   gtp_echo_req(ggc->gsn, ggc->gtp_version, NULL, >remote_addr);
+   LOGGGSN(ggc, LOGL_INFO, "GTP Tx Echo Request\n");
+   gtp_echo_req(ggc->gsn, ggc->gtp_version, ggc, >remote_addr);
 }

 #ifdef BUILD_IU
@@ -579,13 +580,15 @@
 }

 /* Confirmation of an GTP ECHO request */
-static int echo_conf(struct pdp_t *pdp, void *cbp, int recovery)
+static int echo_conf(void *cbp, bool timeout)
 {
-   if (recovery < 0) {
-   LOGP(DGPRS, LOGL_NOTICE, "GTP Echo Request timed out\n");
+   struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *)cbp;
+   if (timeout) {
+   LOGGGSN(ggc, LOGL_NOTICE, "GTP Echo Request timed out\n");
/* FIXME: if version == 1, retry with version 0 */
+   sgsn_ggsn_ctx_drop_all_pdp(ggc);
} else {
-   DEBUGP(DGPRS, "GTP Rx Echo Response\n");
+   LOGGGSN(ggc, LOGL_INFO, "GTP Rx Echo Response\n");
}
return 0;
 }
@@ -630,8 +633,8 @@

switch (type) {
case GTP_ECHO_REQ:
-   /* libgtp hands us the RECOVERY number instead of a cause */
-   return echo_conf(pdp, cbp, cause);
+   /* libgtp hands us the RECOVERY number instead of a cause (EOF 
on timeout) */
+   return echo_conf(cbp, cause == EOF);
case GTP_CREATE_PDP_REQ:
return create_pdp_conf(pdp, cbp, cause);
case GTP_DELETE_PDP_REQ:

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15308
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I7e97bac1c13a2c26203eb64e590fd75d77eb44bd
Gerrit-Change-Number: 15308
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-sgsn[master]: Introduce log helper LOGGGSN

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15307


Change subject: Introduce log helper LOGGGSN
..

Introduce log helper LOGGGSN

It will be used in forthcoming commits.

Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
---
M include/osmocom/sgsn/debug.h
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/sgsn_main.c
3 files changed, 11 insertions(+), 0 deletions(-)



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

diff --git a/include/osmocom/sgsn/debug.h b/include/osmocom/sgsn/debug.h
index 4d0fc69..29d500d 100644
--- a/include/osmocom/sgsn/debug.h
+++ b/include/osmocom/sgsn/debug.h
@@ -39,6 +39,7 @@
DVLR,
DIUCS,
DSIGTRAN,
+   DGTP,
Debug_LastEntry,
 };

diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 48c063d..55aae86 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -405,6 +405,11 @@
 void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx 
*pdp);
 void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc);

+#define LOGGGSN(ggc, level, fmt, args...) { \
+   char _buf[INET_ADDRSTRLEN]; \
+   LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, ggc->id, 
inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \
+   } while (0)
+
 struct apn_ctx {
struct llist_head list;
struct sgsn_ggsn_ctx *ggsn;
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 4232e23..fe6823e 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -340,6 +340,11 @@
.name = "DV42BIS",
.description = "V.42bis data compression (SNDCP)",
.enabled = 1, .loglevel = LOGL_NOTICE,
+   },
+   [DGTP] = {
+   .name = "DGTP",
+   .description = "GPRS Tunnelling Protocol (GTP)",
+   .enabled = 1, .loglevel = LOGL_NOTICE,
}
 };


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15307
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
Gerrit-Change-Number: 15307
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-ttcn3-hacks[master]: sgsn: Introduce test TC_attach_echo_timeout

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15306


Change subject: sgsn: Introduce test TC_attach_echo_timeout
..

sgsn: Introduce test TC_attach_echo_timeout

This test verifies sgsn drops all GGSN related pdp context when that
GGSN stops answering echo requests.

Change-Id: Ic31748924e7bf05ea2ccf2b1be0c460eefed5782
---
M sgsn/SGSN_Tests.ttcn
M sgsn/expected-results.xml
2 files changed, 63 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/06/15306/1

diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index b146046..db7d54b 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -61,6 +61,7 @@
charstring mp_hlr_ip := "127.0.0.1";
integer mp_hlr_port := 4222;
charstring mp_ggsn_ip := "127.0.0.2";
+   integer mp_echo_interval := 5; /* in seconds. Only used in test 
enabling g_use_echo  */

NSConfigurations mp_nsconfig := {
{
@@ -259,7 +260,7 @@

 private function f_vty_enable_echo_interval(boolean enable) runs on test_CT {
if (enable) {
-   f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval 5");
+   f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval " & 
int2str(mp_echo_interval));
} else {
f_vty_config(SGSNVTY, "sgsn", "ggsn 0 no echo-interval");
}
@@ -1539,6 +1540,65 @@
vc_conn.done;
 }

+private function f_TC_attach_echo_timeout(charstring id) runs on 
BSSGP_ConnHdlr {
+   var Gtp1cUnitdata g_ud;
+   var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
+   var integer seq_nr;
+
+   /* first perform regular attach */
+   f_TC_attach(id);
+   /* then activate PDP context */
+   f_pdp_ctx_act(apars);
+
+   /* Wait to receive first echo request and send initial Restart counter 
*/
+   GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud {
+   BSSGP[0].clear;
+   seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
+   GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, 
apars.ggsn_restart_ctr));
+   f_sleep(int2float(mp_echo_interval)); /* wait until around next 
echo is expected */
+   }
+
+   /* At some point next echo request not answered will timeout and SGSN
+  should drop the pdp ctx. Around T3 (3secs) * 6 (+ extra, a lot due 
to OS#4178): */
+   timer T := 3.0 * 6.0 + 16.0;
+   T.start;
+   alt {
+   [] BSSGP[0].receive(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true)) 
{
+   f_send_l3_gmm_llc(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid));
+   setverdict(pass);
+   }
+   [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextRequest, 
apars.ggsn_tei_c)) -> value g_ud {
+   /* SGSN currently doesn't send this message because it 
expects GGSN to be non-reachable anyway */
+   seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
+   log("Received deletePDPContextRequest seq_nr=" & 
int2str(seq_nr));
+   GTP.send(ts_GTPC_DeletePdpResp(g_ud.peer, seq_nr, 
apars.sgsn_tei_c, '7F'O));
+   repeat;
+   }
+   [] GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value 
g_ud {
+   seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber);
+   log("Received EchoRequest seq_nr=" & int2str(seq_nr));
+   repeat;
+   }
+   [] T.timeout {
+   setverdict(fail, "BSSGP DeactPdpReq not received");
+   mtc.stop;
+   }
+   [] as_xid(apars);
+   }
+   T.stop
+
+   setverdict(pass);
+}
+/* ATTACH + trigger Recovery procedure through CreatePdpResp */
+testcase TC_attach_echo_timeout() runs on test_CT {
+   var BSSGP_ConnHdlr vc_conn;
+   g_use_echo := true;
+   f_init();
+   vc_conn := f_start_handler(refers(f_TC_attach_echo_timeout), 
testcasename(), g_gb, 67, 50.0);
+   vc_conn.done;
+   g_use_echo := false;
+}
+
 private function f_TC_attach_restart_ctr_echo(charstring id) runs on 
BSSGP_ConnHdlr {
var Gtp1cUnitdata g_ud;
var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip));
@@ -2597,6 +2657,7 @@
execute( TC_attach_pdp_act_user_deact_mt() );
execute( TC_attach_pdp_act_deact_dup() );
execute( TC_attach_second_attempt() );
+   execute( TC_attach_echo_timeout() );
execute( TC_attach_restart_ctr_echo() );
execute( TC_attach_restart_ctr_create() );
execute( TC_attach_pdp_act_deact_mt_t3395_expire() );
diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml
index d9c3706..fc8856a 100644
--- a/sgsn/expected-results.xml
+++ b/sgsn/expected-results.xml
@@ -54,6 +54,7 @@

Change in ...osmo-ggsn[master]: gtp: Log msg retransmits and timeouts

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ggsn/+/15305


Change subject: gtp: Log msg retransmits and timeouts
..

gtp: Log msg retransmits and timeouts

Change-Id: Ie768ddb45313582b4b5358b97a981080be64fd42
---
M gtp/gtp.c
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/gtp/gtp.c b/gtp/gtp.c
index f70f534..2ea949d 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -600,10 +600,14 @@
   (qmsg->timeout <= now)) {
/*printf("Retrans timeout found: %d\n", (int) time(NULL)); */
if (qmsg->retrans > N3_REQUESTS) {  /* To many retrans */
+   LOGP(DLGTP, LOGL_NOTICE, "Timeout of seq %" PRIu16 "\n",
+qmsg->seq);
if (gsn->cb_conf)
gsn->cb_conf(qmsg->type, EOF, NULL, qmsg->cbp);
queue_freemsg(gsn->queue_req, qmsg);
} else {
+   LOGP(DLGTP, LOGL_INFO, "Retransmit (%d) of seq %" 
PRIu16 "\n",
+qmsg->retrans, qmsg->seq);
if (sendto(qmsg->fd, >p, qmsg->l, 0,
   (struct sockaddr *)>peer,
   sizeof(struct sockaddr_in)) < 0) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/15305
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie768ddb45313582b4b5358b97a981080be64fd42
Gerrit-Change-Number: 15305
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-sgsn[master]: gtp: make echo_interval unsigned

2019-08-28 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15304


Change subject: gtp: make echo_interval unsigned
..

gtp: make echo_interval unsigned

There's no real need to use -1 to indicate echo timer as disabled, since
0 can also be used (it doesn't make sense to have a timer timeout of 0).
This way code is simplified.

Change-Id: I689034887188a53590eddeffda781629694eb5ed
---
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/gprs_sgsn.c
M src/gprs/sgsn_vty.c
3 files changed, 5 insertions(+), 6 deletions(-)



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

diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 336155c..48c063d 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -392,7 +392,7 @@
struct gsn_t *gsn;
struct llist_head pdp_list; /* list of associated pdp ctx (struct 
sgsn_pdp_ctx*) */
struct osmo_timer_list echo_timer;
-   int echo_interval;
+   unsigned int echo_interval;
 };
 struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
 void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc);
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index 9f02d54..7174bd5 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -500,7 +500,7 @@
bool pending = osmo_timer_pending(>echo_timer);

/* Only enable if allowed by policy and at least 1 pdp ctx exists 
against ggsn */
-   if (!llist_empty(>pdp_list) && ggc->echo_interval > 0) {
+   if (!llist_empty(>pdp_list) && ggc->echo_interval) {
if (!pending)
osmo_timer_schedule(>echo_timer, 
ggc->echo_interval, 0);
} else {
@@ -528,7 +528,6 @@
ggc->id = id;
ggc->gtp_version = 1;
ggc->remote_restart_ctr = -1;
-   ggc->echo_interval = -1;
/* if we are called from config file parse, this gsn doesn't exist yet 
*/
ggc->gsn = sgsn->gsn;
INIT_LLIST_HEAD(>pdp_list);
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 68d3a77..42b5121 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -190,8 +190,8 @@
inet_ntoa(gctx->remote_addr), VTY_NEWLINE);
vty_out(vty, " ggsn %u gtp-version %u%s", gctx->id,
gctx->gtp_version, VTY_NEWLINE);
-   if (gctx->echo_interval != -1)
-   vty_out(vty, " ggsn %u echo-interval %"PRId32"%s",
+   if (gctx->echo_interval)
+   vty_out(vty, " ggsn %u echo-interval %u%s",
gctx->id, gctx->echo_interval, VTY_NEWLINE);
else
vty_out(vty, " ggsn %u no echo-interval%s",
@@ -395,7 +395,7 @@
uint32_t id = atoi(argv[0]);
struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);

-   ggc->echo_interval = -1;
+   ggc->echo_interval = 0;
sgsn_ggsn_ctx_check_echo_timer(ggc);

return CMD_SUCCESS;

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15304
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I689034887188a53590eddeffda781629694eb5ed
Gerrit-Change-Number: 15304
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in ...osmo-sip-connector[master]: mncc: do not unregister unregistered osmo fds

2019-08-28 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303 )

Change subject: mncc: do not unregister unregistered osmo fds
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c
File src/mncc.c:

https://gerrit.osmocom.org/#/c/15303/2/src/mncc.c@327
PS2, Line 327:  if (osmo_fd_is_registered(>fd))
Just wondering, we are also unconditionally closing conn->fd.fd. Can it happen 
that fd.fd exists but fd is not registered? Probably not.



--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Gerrit-Change-Number: 15303
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 28 Aug 2019 13:41:13 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-sip-connector[master]: mncc: do not unregister unregistered osmo fds

2019-08-28 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303

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

Change subject: mncc: do not unregister unregistered osmo fds
..

mncc: do not unregister unregistered osmo fds

The function close_connection() calls osmo_fd_unregister() without
checking if the osmo_fd is registered at all. Lets make sure the osmo_fs
is registered by checking it using osmo_fd_is_registered()

Related: OS#4159
Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
---
M src/mncc.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/03/15303/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Gerrit-Change-Number: 15303
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in ...osmo-sip-connector[master]: mncc: do not unregister unregistered osmo fds

2019-08-28 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303


Change subject: mncc: do not unregister unregistered osmo fds
..

mncc: do not unregister unregistered osmo fds

The function close_connection() calls osmo_fd_unregister() without
checking if the osmo_fd is registered at all. Lets make sure the osmo_fs
is registered by checking it using osmo_fd_unregister()

Related: OS#4159
Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
---
M src/mncc.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/03/15303/1

diff --git a/src/mncc.c b/src/mncc.c
index e23bd6f..63e4faa 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -324,7 +324,8 @@
 /* Close the MNCC connection/socket */
 static void close_connection(struct mncc_connection *conn)
 {
-   osmo_fd_unregister(>fd);
+   if (osmo_fd_is_registered(>fd))
+   osmo_fd_unregister(>fd);
close(conn->fd.fd);
osmo_timer_schedule(>reconnect, 5, 0);
conn->state = MNCC_DISCONNECTED;

--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/15303
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9742f31a37296fed15d54cf44c1f65b93abb8c8e
Gerrit-Change-Number: 15303
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in ...osmo-bsc[master]: gsm_08_08.c: always pick first msc for unsolicit paging responses

2019-08-28 Thread dexter
dexter has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/15227 )

Change subject: gsm_08_08.c: always pick first msc for unsolicit paging 
responses
..


Abandoned

This is duplicate
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15227
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I633870030fad35d0a29dfafd6d118e2caa4ec3c9
Gerrit-Change-Number: 15227
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: abandon


Change in ...osmo-bsc[master]: gsm_08_08.c: always pick first msc for unsolicit paging responses

2019-08-28 Thread dexter
Hello fixeria, Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-bsc/+/15209

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

Change subject: gsm_08_08.c: always pick first msc for unsolicit paging 
responses
..

gsm_08_08.c: always pick first msc for unsolicit paging responses

When osmo-bsc receives a paging response via the A-bis interface it
tries to find the MSC which is in charge for the paging. This is due to
the fact that osmo-bsc supports multiple msc connections, which is not
specified by 3gpp specs.

In an MT-CSFB call the MSC pages the UE via the SGs interface. Then the
UE falls back to 2G. It then reports back as MS on the A-Bis interface
with the paging response directly. In those cases osmo-bsc will not be
able to determine an MSC in charge, so we will forward the paging
response to the first configured MSC.

Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Related: SYS#4624
---
M src/osmo-bsc/gsm_08_08.c
1 file changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/15209/2
-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/15209
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7f091ed1bbc2afe12656e42031e122144eeb6826
Gerrit-Change-Number: 15209
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: laforge 
Gerrit-CC: neels 
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-sgsn[master]: libgtp: don't call sgsn_pdp_ctx_free() with NULL pdp

2019-08-28 Thread keith
keith has abandoned this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/13929 )

Change subject: libgtp: don't call sgsn_pdp_ctx_free() with NULL pdp
..


Abandoned
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/13929
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I184dcce27b26104c61d80b2d910388d5d3323def
Gerrit-Change-Number: 13929
Gerrit-PatchSet: 5
Gerrit-Owner: keith 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: keith 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-CC: laforge 
Gerrit-CC: neels 
Gerrit-MessageType: abandon


  1   2   >