From patchwork Wed Sep 25 15:13:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3877 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c93:b0:5b9:581e:f939 with SMTP id p19csp389437may; Wed, 25 Sep 2024 08:14:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1lQeZI5CTY7IFFN2dLEE58NOOr/TMX1YCa0peKxbPxOk+aO3JhFVRybD92Svz83Zt1FTgeVm6wKU=@openvpn.net X-Google-Smtp-Source: AGHT+IHhe0jqer+Vmi/iNZGsHAhADoQOwjOi0+ewGZ/CHfdUMwweXBWrxL5Fe8avVW4BcPiq4OLg X-Received: by 2002:a05:6602:6401:b0:82c:ed3d:3a59 with SMTP id ca18e2360f4ac-83247e624c6mr374242939f.10.1727277247745; Wed, 25 Sep 2024 08:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727277247; cv=none; d=google.com; s=arc-20240605; b=VR95+ISK3xfHyiCPh5Pdg5OUdufjtCPCuX13DTHiVkZecK9pjAFpNTK6VJWOCQF5tr UujsK9qGYPbQ4L6Ji2pDf6eem8m89ab4px6ozNc7HAYe9zZPHM/l4wZe/AVMfgAcs1Hb G3o+CgUN9uERb7xc/cvidr3kMREzz9BX2haQ2tg7F0AjveKTN+P850KVbaVg0igs70wm dCLCjOsUrzugYixmG741G/2ZlouwJqQg79Xwx/NvCyN9Z6JGW3Z7bykmTxzGdwTyCe4O Xc+qFKySqlaW9ajFVN/WSn5R+bIMoxjlr9auUUnG91ayw2WnL5UXPl5crJ+KsbPzsLYe gaxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=haNLoladSoBM65RNx/MP/2zcHDvfDlodCFpq2hGNiwI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ioqXnWLBfrvGEY7eHw6R4mUQObkkqDrmBIVXhrYPa4Nm3UOwx9RsDMRnCiXnsfMCWo IPD/B0LekVNi1N4DfpcHPsm2QGOCvrSJOtZYnlr8JDkxPWVR/HZnjuffabrnzkuGo6OT SahqZwFoucWdxeYfgowvpD969WdgYzr6+h8M6k9ST6ArGT5r1r/DgbPeQsRKqb8PcJHc FJyTbbZyh6dQ6m45Z6JaKi8KcKvsnzXKUjHh5x+0fvYNJw5U3VkP5tAAYRPH1oUH5/5Y YRYvwu6tndj/urfSGbX2wV3IHb1ZIHQb/2tK4gFutkB7FpWxmfzgNUaryrVaVgifWN71 2tdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WhBW5HK0; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=j29fA2r+; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4d40f141989si1861233173.36.2024.09.25.08.14.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Sep 2024 08:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=WhBW5HK0; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=j29fA2r+; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1stTiI-0008PF-Pt; Wed, 25 Sep 2024 15:13:58 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1stTiG-0008P7-HE for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 15:13:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xOn1se984ESJkfd2996BR1B6DhPIzBPyLJMYQIX4hYY=; b=WhBW5HK0YtHYzZwpThzBJQJ5wn L2QFzYslmJaUX8GNRl9mI+rdmypmywDrPzV3bBjfxyDvdZ8YK1moT3enDxh4ybdDAHm+51dgpqLv4 fIMdjMLFRFlju0tzdyQLXicuj1OCGHYfX1AauXXFFLA4VtfxySENGLvawVWTP4+9QydE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xOn1se984ESJkfd2996BR1B6DhPIzBPyLJMYQIX4hYY=; b=j29fA2r+KOJWcBvYuOtanN1zS9 IkT5zFLZJtCVNRVAd3buq6N5OW7msNFuryrASC193BusndxLAjyJ84x7LMDGB0szcL/Bh6JqOnDjb YF1Z15T63FAwIZ28rjF4lIqwahjGuhitz26zdzf0ITJAVUfZwg3PUAzcOSY+HTF8S0IE=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1stTiF-0000dp-3e for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 15:13:55 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 48PFDhRH013317 for ; Wed, 25 Sep 2024 17:13:43 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 48PFDhRF013316 for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 17:13:43 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 25 Sep 2024 17:13:42 +0200 Message-ID: <20240925151342.13307-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.44.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe 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. Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1stTiF-0000dp-3e Subject: [Openvpn-devel] [PATCH v1] Fix check for CMake not detecting struct cmsg X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811181467496511245?= X-GMAIL-MSGID: =?utf-8?q?1811181467496511245?= From: Arne Schwabe 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/771 This mail reflects revision 1 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Frank Lichtenheld 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_CMSGHDR) + + # Some OS (e.g. FreeBSD) need some basic headers to allow # including network headers set(NETEXTRA sys/types.h)