pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/41939?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: core: always build tun.c and gate TUN support by headers
......................................................................
core: always build tun.c and gate TUN support by headers
Always build tun.c and move platform-specific checks into the
implementation.
Guard the TUN-specific code paths based on the availability of
linux/if_tun.h detected at configure time. If TUN support is not
available, osmo_tundev_open() returns -ENOTSUP.
This keeps the public TUN API available while disabling unsupported
functionality in a capability-based way.
Change-Id: I6d1ea1644d12ef59a54cf2f73b9155def58b17a9
---
M configure.ac
M src/core/tun.c
2 files changed, 10 insertions(+), 3 deletions(-)
Approvals:
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/configure.ac b/configure.ac
index 5c10f12..18807f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -628,6 +628,9 @@
CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports],
[Runtime SIMD detection will be disabled])
+dnl Check header linux/if_tun.h
+AC_CHECK_HEADERS([linux/if_tun.h])
+
dnl Check header linux/tcp.h
AC_CHECK_HEADERS([linux/tcp.h])
diff --git a/src/core/tun.c b/src/core/tun.c
index 09a3f81..537caf9 100644
--- a/src/core/tun.c
+++ b/src/core/tun.c
@@ -84,10 +84,8 @@
#include <sys/time.h>
#include <net/if.h>
-#if defined(__linux__)
+#ifdef HAVE_LINUX_IF_TUN_H
#include <linux/if_tun.h>
-#else
-#error "Unknown platform!"
#endif
#include <osmocom/core/utils.h>
@@ -265,6 +263,7 @@
talloc_free(tundev);
}
+#ifdef HAVE_LINUX_IF_TUN_H
/*! Open and configure fd of the tunnel device.
* \param[in] tundev The tundev object whose tunnel interface to open
* \param[in] flags internal linux flags to pass when creating the device (not used yet)
@@ -337,6 +336,7 @@
close(fd);
return rc;
}
+#endif /* HAVE_LINUX_IF_TUN_H */
/*! Open the tunnel device owned by the tundev object.
* \param[in] tundev The tundev object to open
@@ -344,6 +344,7 @@
*/
int osmo_tundev_open(struct osmo_tundev *tundev)
{
+#ifdef HAVE_LINUX_IF_TUN_H
struct osmo_netns_switch_state switch_state;
int rc;
int netns_fd = -1;
@@ -418,6 +419,9 @@
if (netns_fd >= 0)
close(netns_fd);
return rc;
+#else
+ return -ENOTSUP;
+#endif /* HAVE_LINUX_IF_TUN_H */
}
/*! Close the tunnel device owned by the tundev object.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41939?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6d1ea1644d12ef59a54cf2f73b9155def58b17a9
Gerrit-Change-Number: 41939
Gerrit-PatchSet: 3
Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, fixeria, osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/41977?usp=email )
Change subject: repo-install-test: debian 10: osmo-gbproxy only
......................................................................
Patch Set 2:
(1 comment)
File scripts/repo-install-test/run-inside.sh:
https://gerrit.osmocom.org/c/osmo-ci/+/41977/comment/526006fa_63978f5a?usp=… :
PS2, Line 366: # Get a list of all packages from the repository. Reference:
Can't you leave the generic path for debian10 too here?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41977?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Id8d8cda8e399719f06aeb1843eb8f5ab12a90e8f
Gerrit-Change-Number: 41977
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Jan 2026 10:57:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: daniel, fixeria, osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/41976?usp=email )
Change subject: repo-install-test: test osmo-pfcp-tool in latest
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41976?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Icca5a31270bca03596be8ed0104bfb7143fb1ede
Gerrit-Change-Number: 41976
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Jan 2026 10:55:03 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41975?usp=email )
Change subject: logging_file: Fix log_target_file_switch_to_stream on stderr
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41975?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: I1c0d833fb8ae82d1dd54e44cc2fc8be80d5e1b4b
Gerrit-Change-Number: 41975
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 29 Jan 2026 10:50:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes