Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604 )
Change subject: tcpdump capture script: check permissions to fix running in a netns
......................................................................
tcpdump capture script: check permissions to fix running in a netns
This might be all caps (=ep), or a list of all caps.
Change-Id: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d
---
M ttcn3-tcpdump-start.sh
1 file changed, 13 insertions(+), 0 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Hoernchen: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/ttcn3-tcpdump-start.sh b/ttcn3-tcpdump-start.sh
index 9b7a8b5..0ce07cd 100755
--- a/ttcn3-tcpdump-start.sh
+++ b/ttcn3-tcpdump-start.sh
@@ -42,6 +42,19 @@
/sbin/setcap -q -v 'cap_net_admin,cap_net_raw=pie' $DUMPCAP
CAP_ERR="$?"
fi
+
+ # did we implicitly inherit all those caps because we're root in a netns?
+ if [ -u $DUMPCAP -o "$CAP_ERR" = "1" ]; then
+ getpcaps 0 2>&1 | grep -e cap_net_admin | grep -q -e cap_net_raw
+ CAP_ERR="$?"
+ fi
+
+ # did we implicitly inherit all those caps because we're root in a netns?
+ if [ -u $DUMPCAP -o "$CAP_ERR" = "1" ]; then
+ getpcaps 0 2>&1 | grep -q -e " =ep" # all perms
+ CAP_ERR="$?"
+ fi
+
if [ -u $DUMPCAP -o "$CAP_ERR" = "0" ]; then
CMD="$DUMPCAP -q"
else
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27604
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: I75f7af6cc67e96ffb7b002591f7f7d1da9b5a51d
Gerrit-Change-Number: 27604
Gerrit-PatchSet: 9
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 )
Change subject: msc tests: fix test so they don't depend on previous test runs
......................................................................
msc tests: fix test so they don't depend on previous test runs
The test currently implicitly check the vlr state left by preceding tests.
Change-Id: Iebaecd28a426b15baf4729f40b46dd33da79cbae
---
M msc/MSC_Tests.ttcn
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Hoernchen: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 5bf199c..7244555 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1170,7 +1170,7 @@
f_expect_mm_info();
/* wait for normal teardown */
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id := false);
/* Now the same IMSI is still attached in the VLR, and a LU with an unknown TMSI reveals the same IMSI only
* later during ID Response. osmo-msc first creates a new vlr_subscr for the unknown TMSI, and as soon as the
@@ -1207,7 +1207,7 @@
f_expect_mm_info();
/* wait for normal teardown */
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id := false);
}
testcase TC_attached_imsi_lu_unknown_tmsi() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
@@ -4410,7 +4410,7 @@
mtc.stop;
}
}
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id:=false);
}
testcase TC_lu_with_invalid_mcc_mnc() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
@@ -6386,7 +6386,7 @@
f_msc_lu_hlr();
f_mm_imei();
f_expect_lu_reject();
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id:=false);
}
testcase TC_lu_imsi_auth_tmsi_check_imei_nack() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
@@ -6416,7 +6416,7 @@
f_msc_lu_hlr();
f_mm_imei();
f_expect_lu_reject();
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id:=false);
}
testcase TC_lu_imsi_auth_tmsi_check_imei_err() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
@@ -6507,7 +6507,7 @@
f_mm_imei_early();
f_expect_lu_reject();
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id:=false);
}
testcase TC_lu_imsi_auth_tmsi_check_imei_early_nack() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
@@ -6535,7 +6535,7 @@
f_mm_imei_early();
f_expect_lu_reject();
- f_expect_clear();
+ f_expect_clear(verify_vlr_cell_id:=false);
}
testcase TC_lu_imsi_auth_tmsi_check_imei_early_err() runs on MTC_CT {
var BSC_ConnHdlr vc_conn;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603
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: Iebaecd28a426b15baf4729f40b46dd33da79cbae
Gerrit-Change-Number: 27603
Gerrit-PatchSet: 5
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Hoernchen has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603 )
Change subject: msc tests: fix test so they don't depend on previous test runs
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27603
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: Iebaecd28a426b15baf4729f40b46dd33da79cbae
Gerrit-Change-Number: 27603
Gerrit-PatchSet: 4
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 24 May 2022 08:30:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Hoernchen has submitted this change. ( https://gerrit.osmocom.org/c/libasn1c/+/28174 )
Change subject: configure.ac: fix libtool issue with clang and sanitizer
......................................................................
configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all. For those
builds LD shoud be set to clang too (and LDFLAGS needs the sanitizer
flags as well), because the clang compiler driver knows how linking to
the sanitizer libs works, but then at a later stage libtool fails to
actually produce the shared libraries and the build fails. This is fixed
by this patch.
Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:
SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan' export
CC=clang-10 ASANPATH=$(dirname `$CC
-print-file-name=libclang_rt.asan-x86_64.so`) export
LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"
Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e
---
M configure.ac
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Hoernchen: Looks good to me, approved
diff --git a/configure.ac b/configure.ac
index 8c93c3f..6ba1d37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,11 @@
AC_CONFIG_MACRO_DIR([m4])
+dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang
+AS_CASE(["$LD"],[*clang*],
+ [AS_CASE(["${host_os}"],
+ [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
+
PKG_CHECK_MODULES(LIBTALLOC, talloc)
AC_ARG_ENABLE(sanitize,
--
To view, visit https://gerrit.osmocom.org/c/libasn1c/+/28174
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libasn1c
Gerrit-Branch: master
Gerrit-Change-Id: Ie38fa9985187c76b4e456d8b0a83006ef341b97e
Gerrit-Change-Number: 28174
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/28177 )
Change subject: coding: separate gsm0503_tch_a[fh]s_decode_inband()
......................................................................
coding: separate gsm0503_tch_a[fh]s_decode_inband()
These functions can be re-used for parsing in-band data from DTX
specific frames like SID_FIRST, SID_UPDATE, SID_ONSET, etc.
Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf
Related: OS#5570
---
M src/coding/gsm0503_coding.c
1 file changed, 46 insertions(+), 26 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/28177/1
diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c
index 168e120..9ddc094 100644
--- a/src/coding/gsm0503_coding.c
+++ b/src/coding/gsm0503_coding.c
@@ -2115,6 +2115,26 @@
return 0;
}
+/* TCH/AFS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */
+static uint8_t gsm0503_tch_afs_decode_inband(const sbit_t *cB)
+{
+ unsigned int id, best = 0;
+ unsigned int i, j, k;
+
+ for (i = 0; i < 4; i++) {
+ /* FIXME: why not using remaining (16 - 8) soft-bits here? */
+ for (j = 0, k = 0; j < 8; j++)
+ k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j]));
+
+ if (i == 0 || k < best) {
+ best = k;
+ id = i;
+ }
+ }
+
+ return id;
+}
+
/*! Perform channel decoding of a TCH/AFS channel according TS 05.03
* \param[out] tch_data Codec frame in RTP payload format
* \param[in] bursts buffer containing the symbols of 8 bursts
@@ -2157,7 +2177,7 @@
{
sbit_t iB[912], cB[456], h;
ubit_t d[244], p[6], conv[250];
- int i, j, k, best = 0, rv, len, steal = 0, id = -1;
+ int i, rv, len, steal = 0, id = -1;
*n_errors = 0; *n_bits_total = 0;
static ubit_t sid_first_dummy[64] = { 0 };
sbit_t sid_update_enc[256];
@@ -2236,18 +2256,8 @@
}
}
- for (i = 0; i < 4; i++) {
- for (j = 0, k = 0; j < 8; j++)
- k += abs(((int)gsm0503_afs_ic_sbit[i][j]) - ((int)cB[j]));
-
- if (i == 0 || k < best) {
- best = k;
- id = i;
- }
- }
-
- /* Check if indicated codec fits into range of codecs */
- if (id >= codecs) {
+ /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */
+ if ((id = gsm0503_tch_afs_decode_inband(&cB[0])) >= codecs) {
/* Codec mode out of range, return id */
return id;
}
@@ -2578,6 +2588,26 @@
return -1;
}
+/* TCH/AHS: parse codec ID (CMI or CMC/CMR) from coded in-band data (16 bit) */
+static uint8_t gsm0503_tch_ahs_decode_inband(const sbit_t *cB)
+{
+ unsigned int id, best = 0;
+ unsigned int i, j, k;
+
+ for (i = 0, k = 0; i < 4; i++) {
+ /* FIXME: why not using remaining (16 - 4) soft-bits here? */
+ for (j = 0, k = 0; j < 4; j++)
+ k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j]));
+
+ if (i == 0 || k < best) {
+ best = k;
+ id = i;
+ }
+ }
+
+ return id;
+}
+
/*! Perform channel decoding of a TCH/AFS channel according TS 05.03
* \param[out] tch_data Codec frame in RTP payload format
* \param[in] bursts buffer containing the symbols of 8 bursts
@@ -2622,7 +2652,7 @@
{
sbit_t iB[912], cB[456], h;
ubit_t d[244], p[6], conv[135];
- int i, j, k, best = 0, rv, len, steal = 0, id = -1;
+ int i, rv, len, steal = 0, id = -1;
static ubit_t sid_first_dummy[64] = { 0 };
/* only unmap the stealing bits */
@@ -2738,18 +2768,8 @@
}
}
- for (i = 0; i < 4; i++) {
- for (j = 0, k = 0; j < 4; j++)
- k += abs(((int)gsm0503_ahs_ic_sbit[i][j]) - ((int)cB[j]));
-
- if (i == 0 || k < best) {
- best = k;
- id = i;
- }
- }
-
- /* Check if indicated codec fits into range of codecs */
- if (id >= codecs) {
+ /* Parse codec ID (CMI or CMC/CMR) and check if it fits into range of codecs */
+ if ((id = gsm0503_tch_ahs_decode_inband(&cB[0])) >= codecs) {
/* Codec mode out of range, return id */
return id;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28177
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0106de7a7f87517006e323299b2dc08457d1c6cf
Gerrit-Change-Number: 28177
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange