laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35063?usp=email )
Change subject: osmo_io: Reject unknown/unsupported modes in osmo_iofd_setup()
......................................................................
osmo_io: Reject unknown/unsupported modes in osmo_iofd_setup()
The current code does not check the value range of the 'mode' parameter
and would later run into OSMO_ASSERT(), rather than rejecting such a
mode from the very beginning.
Change-Id: I10dd612487638f456d0ad59c2cca203f1e098da3
Related: OS#5751
---
M src/core/osmo_io.c
1 file changed, 26 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 1a8c01d..8507f46 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -445,7 +445,18 @@
struct osmo_io_fd *osmo_iofd_setup(const void *ctx, int fd, const char *name, enum osmo_io_fd_mode mode,
const struct osmo_io_ops *ioops, void *data)
{
- struct osmo_io_fd *iofd = talloc_zero(ctx, struct osmo_io_fd);
+ struct osmo_io_fd *iofd;
+
+ /* reject unsupported/unknown modes */
+ switch (mode) {
+ case OSMO_IO_FD_MODE_READ_WRITE:
+ case OSMO_IO_FD_MODE_RECVFROM_SENDTO:
+ break;
+ default:
+ return NULL;
+ }
+
+ iofd = talloc_zero(ctx, struct osmo_io_fd);
if (!iofd)
return NULL;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35063?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I10dd612487638f456d0ad59c2cca203f1e098da3
Gerrit-Change-Number: 35063
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: jolly.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/35082?usp=email )
Change subject: LAPDm: Reject (release) establishment on DCC0, SAPI 0 without L3 payload
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/common/rsl.c:
https://gerrit.osmocom.org/c/osmo-bts/+/35082/comment/59b49993_7d9faff6
PS1, Line 3839: if (msgb_l2len(msg) == sizeof(*rllh) && (rllh->link_id & 0xc7) == 0x00) {
Using our union abis_rsl_link_id and then comparing sapin and cbits individually is probably the more higher-level / cleaner approach than doing low-level bit-masking which no developer understands off their head without reading the relevant spec section.
It's not critical, I just think we should always try to aim making code as readable as possible. Open Source is not written to just execute, but to be read by other developers.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35082?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6819b51a876b8743c2d4a04165b7900723a1631c
Gerrit-Change-Number: 35082
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Comment-Date: Wed, 22 Nov 2023 12:18:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email )
Change subject: Use 'iuh/local-ip' as local IP for RTP sockets
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/35075?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I90e2cbb1765d4d2db5a19f64f0ff09cdc18b7911
Gerrit-Change-Number: 35075
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 22 Nov 2023 12:12:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35087?usp=email )
Change subject: BTS_Tests: extend TC_early_immediate_assignment: run on trx_nr=1
......................................................................
BTS_Tests: extend TC_early_immediate_assignment: run on trx_nr=1
This patch demonstrates the problem with handling of the Early IA:
* the first part remains unchanged: assign a channel on C0 (arfcn=871);
* the second (new) part tests channel assignment on C1 (arfcn=873).
As of now, osmo-bts does not meet our expectations for the second part.
Change-Id: I7517574a8095ddfa05c34c4c3d4accf2bd07894b
Related: SYS#6655
---
M bts/BTS_Tests.ttcn
1 file changed, 31 insertions(+), 3 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index d667344..82a83cf 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -8815,10 +8815,11 @@
if (g_pars.fhp.enabled) {
ch_desc := valueof(ts_ChanDescH1(g_pars.chan_nr, g_pars.fhp.maio_hsn, g_pars.tsc));
} else {
- ch_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, mp_trx_pars[0].arfcn, g_pars.tsc));
+ var GsmArfcn arfcn := mp_trx_pars[g_pars.trx_nr].arfcn;
+ ch_desc := valueof(ts_ChanDescH0(g_pars.chan_nr, arfcn, g_pars.tsc));
}
var GsmRrMessage rr_msg := valueof(ts_IMM_ASS(ra, fn, 0, ch_desc, g_pars.fhp.ma_map));
- RSL.send(ts_RSL_IMM_ASSIGN(enc_GsmRrMessage(rr_msg)));
+ RSL.send(ts_ASP_RSL_UD(ts_RSL_IMM_ASSIGN(enc_GsmRrMessage(rr_msg)))); /* force sending to TRX0 */
/* Do not expect the Immediate Assignment to show up on MS side yet. Even give it one second before the BSC
* requests Chan Activ, to make sure the RR IMM ASS is held back. */
@@ -8859,10 +8860,20 @@
testcase TC_early_immediate_assignment() runs on test_CT {
var ConnHdlr vc_conn;
- var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
+ var ConnHdlrPars pars;
+
f_init();
+
+ /* verify early Immediate Assignment on C0 (the BCCH carrier): TCH/F on TS1 */
+ pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN, trx_nr := 0));
vc_conn := f_start_handler(refers(f_TC_early_immediate_assignment), pars);
vc_conn.done;
+
+ /* verify early Immediate Assignment on C1: TCH/F on TS0 */
+ pars := valueof(t_Pars(t_RslChanNr_Bm(0), ts_RSL_ChanMode_SIGN, trx_nr := 1));
+ vc_conn := f_start_handler(refers(f_TC_early_immediate_assignment), pars);
+ vc_conn.done;
+
Misc_Helpers.f_shutdown(__BFILE__, __LINE__);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35087?usp=email
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: I7517574a8095ddfa05c34c4c3d4accf2bd07894b
Gerrit-Change-Number: 35087
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35086?usp=email )
Change subject: RSL_Emulation: allow RSL_DchanHdlr sandbox escape for both roles
......................................................................
RSL_Emulation: allow RSL_DchanHdlr sandbox escape for both roles
This feature was initially added in 1470fc668 for the RSL_Emulation_CT
operating in the BTS role. In a subsequent patch I also need to escape
the sandbox, but in my case the RSL_Emulation_CT is playing the BSC role.
Change-Id: I42557f85d3e5e7ef7147a87293f5dd1716884534
Related: 1470fc668 "allow ASP_RSL_UD on MSC_ConnHdlr RSL"
Related: SYS#6655
---
M library/RSL_Emulation.ttcn
1 file changed, 25 insertions(+), 3 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index effe83b..891e565 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -651,15 +651,22 @@
cid := f_cid_by_comp_ref(vc_conn);
IPA_PT.send(ts_ASP_RSL_UD(rx_rsl_msg, ConnectionTable[cid].stream_id));
}
- [bts_role] CLIENT_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl {
- IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId));
- }
[not bts_role] CLIENT_PT.receive(tr_RSL_MsgType(?)) -> value rx_rsl_msg sender vc_conn {
cid := f_cid_by_comp_ref(vc_conn);
conn_id := f_trx_conn_map_resolve(ConnectionTable[cid].stream_id);
IPA_PT.send(ts_ASP_RSL_UD(rx_rsl_msg, ConnectionTable[cid].stream_id, conn_id));
}
+ /* allow the RSL_DchanHdlr components to "escape the sandbox" by sending RSL messages
+ * to other transceivers than they're bound to (determined by rx_rsl.streamId) */
+ [bts_role] CLIENT_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl {
+ IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId));
+ }
+ [not bts_role] CLIENT_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl {
+ conn_id := f_trx_conn_map_resolve(rx_rsl.streamId);
+ IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId, conn_id));
+ }
+
/* RSL message from MTC */
[bts_role] CCHAN_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl {
IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId));
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35086?usp=email
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: I42557f85d3e5e7ef7147a87293f5dd1716884534
Gerrit-Change-Number: 35086
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged