pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email )
Change subject: osmo_io: Support rx of segments up to ~UINT16_MAX
......................................................................
Patch Set 3: -Code-Review
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
Gerrit-Change-Number: 41911
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 22 Jan 2026 11:40:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: Timur Davydov.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41878?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: build: detect netns support via configure-time capability checks
......................................................................
build: detect netns support via configure-time capability checks
The netns API was previously guarded by platform-specific preprocessor
conditions (e.g. !EMBEDDED and defined(__linux__)), which caused the
netns headers and implementation to be entirely excluded from non-Linux
builds such as Emscripten. This in turn led to build failures in code
depending on the netns API, as the symbols and declarations were not
available at all.
Replace the hard-coded platform checks with explicit configure-time
capability detection. The build now checks for the concrete requirements
needed by netns and netdev support, including the availability of setns(), unshare(),
mount(), the CLONE_NEWNET macro and required headers.
Based on the result of these checks, USE_NETNS is defined and netns support
is either enabled or disabled in a controlled manner.
Netns and netdev support remains disabled for embedded builds.
No functional changes intended for platforms where netns is available.
Change-Id: I2322eb2936bea35596f1fd6b6a713ea5f997b1ea
---
M configure.ac
M include/osmocom/core/netdev.h
M include/osmocom/core/netns.h
M src/core/Makefile.am
M src/core/netdev.c
M src/core/netns.c
6 files changed, 50 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/41878/6
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41878?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2322eb2936bea35596f1fd6b6a713ea5f997b1ea
Gerrit-Change-Number: 41878
Gerrit-PatchSet: 6
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/libosmocore/+/41914?usp=email )
Change subject: osmo_io: Propagate segment_cb errors to the read_cb
......................................................................
osmo_io: Propagate segment_cb errors to the read_cb
Previous logic was to drop an entire msgb in the stream and pretend it
can continue working that way, which clearly makes no sense.
Instead, if segment_cb detects some problem (eg. buggy peer sending
corrupted data according to protocol), propagate the issue through
read_cb() so that the app can act on it, ie. most likely close the
connection.
Related: SYS#7842
Change-Id: I572e68df6799b903507229a9beee6fa7d7d6d652
---
M src/core/osmo_io.c
1 file changed, 19 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/41914/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41914?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I572e68df6799b903507229a9beee6fa7d7d6d652
Gerrit-Change-Number: 41914
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41914?usp=email )
Change subject: osmo_io: Propagate segment_cb errors to the read_cb
......................................................................
osmo_io: Propagate segment_cb errors to the read_cb
Change-Id: I572e68df6799b903507229a9beee6fa7d7d6d652
---
M src/core/osmo_io.c
1 file changed, 19 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/41914/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 5805970..d1cdb8e 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -297,8 +297,11 @@
}
/*! Handle segmentation of the msg. If this function returns *_HANDLE_ONE or MORE then the data in msg will contain
- * one complete message.
- * If there are bytes left over, *pending_out will point to a msgb with the remaining data.
+ * one complete message.
+ * If there are bytes left over, *pending_out will point to a msgb with the remaining data.
+ * Upon IOFD_SEG_ACT_DEFER is returned, errno is set to error value providing reason:
+ * EAGAIN is returned when data is still missing to fill the segment; other error codes are
+ * propagated through read_cb().
*/
static enum iofd_seg_act iofd_handle_segmentation(struct osmo_io_fd *iofd, struct msgb *msg, struct msgb **pending_out)
{
@@ -319,15 +322,12 @@
return IOFD_SEG_ACT_HANDLE_ONE;
}
- if (expected_len == -EAGAIN) {
+ if (expected_len < 0) {
+ if (expected_len != -EAGAIN)
+ LOGPIO(iofd, LOGL_ERROR, "segmentation_cb returned error (%d), skipping msg of size %d\n",
+ expected_len, received_len);
+ errno = -expected_len;
goto defer;
- } else if (expected_len < 0) {
- /* Something is wrong, skip this msgb */
- LOGPIO(iofd, LOGL_ERROR, "segmentation_cb returned error (%d), skipping msg of size %d\n",
- expected_len, received_len);
- *pending_out = NULL;
- msgb_free(msg);
- return IOFD_SEG_ACT_DEFER;
}
extra_len = received_len - expected_len;
@@ -335,8 +335,11 @@
if (extra_len == 0) {
*pending_out = NULL;
return IOFD_SEG_ACT_HANDLE_ONE;
+ }
+
/* segment is incomplete */
- } else if (extra_len < 0) {
+ if (extra_len < 0) {
+ errno = EAGAIN;
goto defer;
}
@@ -455,7 +458,11 @@
if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED))
return;
- } else {
+ } else { /* IOFD_SEG_ACT_DEFER */
+ if (OSMO_UNLIKELY(errno != EAGAIN)) {
+ _call_read_cb(iofd, -errno, msg);
+ return;
+ }
if (OSMO_UNLIKELY(msgb_length(msg) == iofd_msgb_length_max(iofd))) {
LOGPIO(iofd, LOGL_ERROR,
"Rx segment msgb of > %" PRIu16 " bytes (headroom %u bytes) is unsupported, check your segment_cb!\n",
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41914?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I572e68df6799b903507229a9beee6fa7d7d6d652
Gerrit-Change-Number: 41914
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: osmo_io: Support rx of segments up to ~UINT16_MAX
......................................................................
osmo_io: Support rx of segments up to ~UINT16_MAX
Previously if we recevied a big chunk (near UINT16_MAX), we would hit
the following assert in iofd_msgb_alloc2(), because our msgb
implementation can only handle sizes up to 16 bit length, counting
headroom + data length:
"OSMO_ASSERT(size + headroom <= 0xffff);".
This new improved logic allows handling segments of up to ~UINT16_MAX
which may come in in multiple read calls. It also adds logic to catch
received segments greater than UINT16_MAX (or buggy segment_cb or buggy
peer transmitting to us) and notifies the user of a broken stream
through read_cb() in that case.
Related: SYS#7842
Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
---
M src/core/osmo_io.c
1 file changed, 85 insertions(+), 34 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/41911/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
Gerrit-Change-Number: 41911
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Timur Davydov.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41878?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: build: detect netns support via configure-time capability checks
......................................................................
build: detect netns support via configure-time capability checks
The netns API was previously guarded by platform-specific preprocessor
conditions (e.g. !EMBEDDED and defined(__linux__)), which caused the
netns headers and implementation to be entirely excluded from non-Linux
builds such as Emscripten. This in turn led to build failures in code
depending on the netns API, as the symbols and declarations were not
available at all.
Replace the hard-coded platform checks with explicit configure-time
capability detection. The build now checks for the concrete requirements
needed by netns and netdev support, including the availability of setns(), unshare(),
mount(), the CLONE_NEWNET macro and required headers.
Based on the result of these checks, USE_NETNS is defined and netns support
is either enabled or disabled in a controlled manner.
Netns and netdev support remains disabled for embedded builds.
No functional changes intended for platforms where netns is available.
Change-Id: I2322eb2936bea35596f1fd6b6a713ea5f997b1ea
---
M configure.ac
M include/osmocom/core/netdev.h
M include/osmocom/core/netns.h
M src/core/Makefile.am
M src/core/netdev.c
M src/core/netns.c
6 files changed, 45 insertions(+), 18 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/41878/5
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41878?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2322eb2936bea35596f1fd6b6a713ea5f997b1ea
Gerrit-Change-Number: 41878
Gerrit-PatchSet: 5
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Attention is currently required from: Timur Davydov, laforge, neels.
Hello Jenkins Builder, fixeria, neels, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
to look at the new patch set (#14).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Add Emscripten build support and JS callback logging backend
......................................................................
Add Emscripten build support and JS callback logging backend
This change enables building libosmocore for sandboxed, non-POSIX
environments, specifically WebAssembly targets produced via the
Emscripten toolchain.
The broader motivation is to allow partial execution of selected
Osmocom components in isolated runtime environments where direct access
to hardware and traditional operating system facilities (filesystem,
sockets, privileged execution) is not available.
One intended use case is running a GSM 2G base station where the
radio-facing components are executed inside a web environment, while
the remaining Osmocom stack and core network components continue to run
unchanged on a conventional backend server. In this model, highly
stripped-down variants of osmo-bts and osmo-trx are built as static
WebAssembly libraries and executed in the browser, while depending on
core libraries such as libosmocore, libosmo-netif, and libosmo-abis.
A practical advantage of this approach is that no deployment or
privileged setup is required on the radio endpoint side. A user can
instantiate a radio endpoint with minimal configuration, while all
stateful logic and operational complexity remains centralized on the
backend. Multiple such radio endpoints may connect to the same backend
core network, effectively forming a single logical network from the
core network perspective, independent of the physical location of the
radio endpoints.
Existing libosmocore build logic and platform assumptions rely on the
availability of POSIX APIs and OS services which are not present in
WebAssembly runtimes. This currently prevents libosmocore from being
built for such targets without targeted, build-time adjustments. This
patch introduces the minimal set of changes required to enable such
builds, without affecting native platforms.
As part of this groundwork, a minimal callback-based logging hook is
introduced. When building for Emscripten, this hook allows forwarding
log messages to an external environment via a user-provided JavaScript
callback. This enables integration with browser-side logging or UI
infrastructure without introducing new logging backends or runtime
dependencies. For all other build targets, the hook resolves to a no-op
implementation and does not alter existing logging behavior.
No runtime behavior, protocol semantics, or network interactions are
changed by this patch. All modifications are strictly limited to
build-time and platform-specific code paths and are only active when
targeting Emscripten. Native builds and existing deployment scenarios
remain unaffected.
This patch is intended as groundwork. Follow-up changes, proposed
separately and incrementally, may extend similar support to other
Osmocom components such as libosmo-netif, libosmo-abis, osmo-bts, and
osmo-trx, while keeping all such changes optional and isolated from
native builds.
Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
---
M .gitignore
M configure.ac
M include/osmocom/core/logging.h
M src/core/Makefile.am
M src/core/libosmocore.map
A src/core/logging_emscripten.c
M src/core/netdev.c
M src/core/osmo_io_internal.h
M src/core/stats_tcp.c
M src/core/tun.c
M src/vty/logging_vty.c
11 files changed, 188 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/41813/14
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 14
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: osmo_io: Support rx of segments up to ~UINT16_MAX
......................................................................
osmo_io: Support rx of segments up to ~UINT16_MAX
Previously if we recevied a big chunk (near UINT16_MAX), we would hit
the following assert in iofd_msgb_alloc2(), because our msgb
implementation can only handle sizes up to 16 bit length, counting
headroom + data length:
"OSMO_ASSERT(size + headroom <= 0xffff);".
This new improved logic allows handling segments of up to ~UINT16_MAX
which may come in in multiple read calls. It also adds logic to catch
received segments greater than UINT16_MAX (or buggy segment_cb or buggy
peer transmitting to us) and notifies the user of a broken stream
through read_cb() in that case.
Related: SYS#7842
Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
---
M src/core/osmo_io.c
1 file changed, 85 insertions(+), 34 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/41911/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41911?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
Gerrit-Change-Number: 41911
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41899?usp=email )
Change subject: bts: TC_rsl_chan_initial_ta: fix sporadic failures
......................................................................
Patch Set 1:
(1 comment)
File bts/BTS_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41899/comment/f839e8ff_b87a… :
PS1, Line 3894: /* tell trxcon to use a given TA for UL bursts */
> a lot of trxcon blackmagic which is need to "set TA on trxcon"
"set TA on trxcon" is a simplification. This concept of separate TA existed even before trxcon: there's TA that's actually used on the radio interface (set via `f_L1CTL_PARAM()`) and TA indicated to the network in UL SACCH (set via `f_send_meas_rep()`). This is related to the "fake TA" feature of the mobile app. The firmware behaves this way and trxcon replicates that. This is why we do it this way.
The testcase API can be improved in a separate patch. I believe it's a good idea to do `f_send_meas_rep()` in `f_est_dchan()` before calling `f_l1ctl_est_dchan()`. This way we make sure that trxcon always indicates expected/known values in the L1 SACCH header.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41899?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iebb043ccc710750dff937e2281c23d343b85bda1
Gerrit-Change-Number: 41899
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 22 Jan 2026 10:00:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: Timur Davydov, laforge.
pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/libosmocore/+/41895?usp=email )
Change subject: core: always build osmo_sock_multiaddr_* helpers
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41895?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3e70b7cd6cb4d022252e6ddc70a42ca5eea72bb1
Gerrit-Change-Number: 41895
Gerrit-PatchSet: 4
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Comment-Date: Wed, 21 Jan 2026 23:01:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes