From: "cron2 (Code Review)" Date: Wed, 25 Sep 2024 16:36:45 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <3a2b124e44d6ccd03f75c359183362126db865f4-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="5u28UcMClXI="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix check for CMake not detecting struct cmsg List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --5u28UcMClXI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/771?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Fix check for CMake not detecting struct cmsg ...................................................................... Fix check for CMake not detecting struct cmsg This check seems to have never worked and on Linux we hard coded the check instead. Remove this hard coded assumption and use a working check based on check_struct_has_member instead. This is has the side-effect of port-sharing being enabled on macOS when compiled with cmake. Change-Id: Ia020c696f63a2a317f001c061b2ab4da69977750 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20240925151342.13307-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29= 448.html Signed-off-by: Gert Doering --- M CMakeLists.txt 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/771/2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6271574..5db207d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,7 +131,6 @@ set(ENABLE_FEATURE_TUN_PERSIST 1) set(HAVE_LINUX_TYPES_H 1) set(ENABLE_DCO YES) - set(HAVE_CMSGHDR YES) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") set(TARGET_FREEBSD YES) set(ENABLE_DCO YES) @@ -185,7 +184,6 @@ check_symbol_exists(sendmsg sys/socket.h HAVE_SENDMSG) check_symbol_exists(recvmsg sys/socket.h HAVE_RECVMSG) -check_symbol_exists(cmsghdr sys/socket.h HAVE_CMSGHDR) check_symbol_exists(openlog syslog.h HAVE_OPENLOG) check_symbol_exists(syslog syslog.h HAVE_SYSLOG) check_symbol_exists(getgrnam grp.h HAVE_GETGRNAM) @@ -193,6 +191,11 @@ check_symbol_exists(getsockname sys/socket.h HAVE_GETSOCKNAME) check_symbol_exists(getrlimit "sys/time.h;sys/resource.h" HAVE_GETRLIMIT) +# Checking for existence of structs with check_symbol_exists does not work, +# so we use check_struct_hash_member with a member instead +check_struct_has_member("struct cmsghdr" cmsg_len sys/socket.h HAVE_CMSGHD= R) + + # Some OS (e.g. FreeBSD) need some basic headers to allow # including network headers set(NETEXTRA sys/types.h) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/771?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ia020c696f63a2a317f001c061b2ab4da69977750 Gerrit-Change-Number: 771 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --5u28UcMClXI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by plaisthos.

View Change

The following approvals got outdated= and were removed: Code-Review+2 by flichtenheld

Fix check for CMake not detecting struct cmsg=


This check seems to have never worked and on Linux we hard codedthe check instead. Remove this hard coded assumption and use a
working = check based on check_struct_has_member instead.

This is has the side= -effect of port-sharing being enabled on macOS
when compiled with cmake.=

Change-Id: Ia020c696f63a2a317f001c061b2ab4da69977750
Signed-off-= by: Arne Schwabe <arne-openvpn@...1227...>
Acked-by: Frank Lichten= held <frank@...2641...>
Message-Id: <20240925151342.13307-1-ger= t@...1296...>
URL: https://www.mail-archive.com/openvpn-devel@...1096...= ourceforge.net/msg29448.html
Signed-off-by: Gert Doering <gert@...1826...= 6...>
---
M CMakeLists.txt
1 file changed, 5 insertions(+), 2 d= eletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/=
changes/71/771/2
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6271574..5db207d 100644
--- a/CMakeLists.t= xt
+++ b/CMakeLists.txt
@@ -131,7 +131,6 @@=
set(ENABLE_FEATURE_TUN_PERSIST 1)
= set(HAVE_LINUX_TYPES_H 1)
set(ENABLE_DCO YES)=
- set(HAVE_CMSGHDR YES)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(TARGET_FREEBSD YES)
set(ENABLE= _DCO YES)
@@ -185,7 +184,6 @@

<= span> check_symbol_exists(sendmsg sys/socket.h HAVE_SENDMSG)

check_symbol_exists(recvmsg sys/socket.h HAVE_RECVMSG)

-check_symbol_exists(cmsghdr sys/socket.= h HAVE_CMSGHDR)
check_symbol_exists(openlog syslog.h HAVE_= OPENLOG)
check_symbol_exists(syslog syslog.h HAVE_SYSLOG)<= /span>
check_symbol_exists(getgrnam grp.h HAVE_GETGRNAM)@@ -193,6 +191,11 @@
check_symbol_exists(getsockna= me sys/socket.h HAVE_GETSOCKNAME)
check_symbol_exists(getr= limit "sys/time.h;sys/resource.h" HAVE_GETRLIMIT)

+# Checking for ex= istence of structs with check_symbol_exists does not work,
+# so we use check_struct_hash_member= with a member instead
+
+
# Some= OS (e.g. FreeBSD) need some basic headers to allow
# incl= uding network headers
set(NETEXTRA sys/types.h)
=

To view, visit change 771. To unsubscribe, or for help= writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia020c696f63a2a317f001c061b2= ab4da69977750
Gerrit-Change-Number: 771
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--5u28UcMClXI=--