From 75a5b4438bd86e6d8243b937457a72adbe98dfbe Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 12 Nov 2024 05:59:49 -0800 Subject: [PATCH 1/3] Build fix for OpenBSD - See ticket #2397 --- osdep/EthernetTap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osdep/EthernetTap.cpp b/osdep/EthernetTap.cpp index 0be209ecd..6cfc3a9b3 100644 --- a/osdep/EthernetTap.cpp +++ b/osdep/EthernetTap.cpp @@ -140,7 +140,7 @@ std::shared_ptr EthernetTap::newInstance( #endif // __NetBSD__ #ifdef __OpenBSD__ - return std::shared_ptr(new BSDEthernetTap(homePath,mac,mtu,metric,nwid,friendlyName,handler,arg)); + return std::shared_ptr(new BSDEthernetTap(homePath,concurrency,pinning,mac,mtu,metric,nwid,friendlyName,handler,arg)); #endif // __OpenBSD__ #endif // ZT_SDK? From 969c0ee6e367628d47a3fb15d5fb1339cce812bc Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 12 Nov 2024 14:40:24 -0800 Subject: [PATCH 2/3] Omit CPU pinning code on OpenBSD --- osdep/BSDEthernetTap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osdep/BSDEthernetTap.cpp b/osdep/BSDEthernetTap.cpp index d4dbf7f6f..32a498edf 100644 --- a/osdep/BSDEthernetTap.cpp +++ b/osdep/BSDEthernetTap.cpp @@ -431,6 +431,7 @@ void BSDEthernetTap::threadMain() // constructing itself. Thread::sleep(500); +#ifndef __OpenBSD__ bool pinning = _pinning; for (unsigned int i = 0; i < _concurrency; ++i) { @@ -451,6 +452,7 @@ void BSDEthernetTap::threadMain() exit(1); } } +#endif // __OpenBSD__ uint8_t b[ZT_TAP_BUF_SIZE]; MAC to, from; From 82c6454950797287466691144785d93376062239 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 13 Nov 2024 09:01:09 -0800 Subject: [PATCH 3/3] Fix broken ifdef on OpenBSD --- osdep/BSDEthernetTap.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osdep/BSDEthernetTap.cpp b/osdep/BSDEthernetTap.cpp index 32a498edf..b2ea98b3e 100644 --- a/osdep/BSDEthernetTap.cpp +++ b/osdep/BSDEthernetTap.cpp @@ -499,8 +499,10 @@ void BSDEthernetTap::threadMain() } } } +#ifndef __OpenBSD__ })); } +#endif // __OpenBSD__ } } // namespace ZeroTier