From patchwork Wed Sep 25 14:06:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3873 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c93:b0:5b9:581e:f939 with SMTP id p19csp344456may; Wed, 25 Sep 2024 07:07:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUxBeU5XHjKb7ESIOrnvuQXvn8zowkQze3/r6lququuATyUsLoAiwmuoHjXhDjhMGZeVa1+yd/fF74=@openvpn.net X-Google-Smtp-Source: AGHT+IFqp7pW2JvCcxGBOXCEiKrDJmAKkZGw8jxffHQkF3URUOT6YKVKJmAaZHS99HvRVFsVwxS4 X-Received: by 2002:a05:6602:2b83:b0:82c:f2f5:388d with SMTP id ca18e2360f4ac-83247d1c4famr415113739f.7.1727273242141; Wed, 25 Sep 2024 07:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727273242; cv=none; d=google.com; s=arc-20240605; b=KNRQEWvHjdbADvdwM71PTdwlKliHWwTt2ZB9E01kWi4LUrpVxumB7u6QJX9NowakXT BldPapESVFq35/YJGVOtXt/T3cwAFwxP1/jG4BlclBxvn4erCSDcsg4TSXrkt8hFEH/g 3lGVr67pJ7kbSAKiWYi4fhwKyiIPtBeY38VI7AzmGRw0Uk7hqllW/qR6/JvfpBTS5h95 VH7MpwHsxUosB4THsU2jSrZC0ijyzBGoW/C8wA0uJGBE5Y0tNwng/sBM1YXIztC4RYol GKb9XP8VrAn8QQzhvqaKJiDECxW6+0Pl0Xgu+pVmE2xcEjZoc5GMqEaPrLuHj34rvDEb U0wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=ezdLWPlpFNrg/FxythRPp3VzeysCndx6MlYwDwNuSZU=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=I3CgDf/mKrhY6yW7DK6ZzTTNwNdR8dpWTlAOsArJPQXqclHqoIHEaRaqVFtIXh9G2G qQhOoxOH6TF4vM2Te0xoduanvgTGDD3y2DpuIEtf81Jax5hAWR3hpeSLNbOL/jeWtZJ3 Dw9PhbVPpy7CtR18tCU8zWCKdfzTl0XmRVKaEu46IJrEswbmwGfP/xwOqrBIA7u0o5fS PNDMKTlb/nqgggcAO5SuUxPeXFEMWILs7459+9EdwdFTKYZJNsMPIdV2OppwB3wbZz8V apbO8zpCCfpqp+8Bzn2am7SXkktvJpqT7TJ29duiSTjU9nuHORrV9ne5MqiObf1JLkN7 AqVg==; 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=ewxxWQDv; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=IE3XwPw7; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="IWm//dpa"; 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=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id ca18e2360f4ac-8323f5e6c49si163249639f.16.2024.09.25.07.07.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Sep 2024 07:07:22 -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=ewxxWQDv; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=IE3XwPw7; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b="IWm//dpa"; 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=openvpn.net; dara=fail header.i=@openvpn.net 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 1stSfc-0006of-Rf; Wed, 25 Sep 2024 14:07:08 +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 1stSfb-0006oY-Il for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 14:07:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=RqjixCcJzh7f415gAflunYsJj46eShQlEq1XsrjULck=; b=ewxxWQDvgOGXr77CCsmgDNBQbt TU2J7PS7qDOq4WJlbjTAmBcYpdVnursYm1QlxWt10cVhDFj5t2cg9g0mqkmryXAYALwuiW8lXVKP6 hSRFVWc8h6hopNiC4rEzUzyw1LHdeVMssvWoWn9uHq4lt/+FviewmRWy2D5kS/OXXAg4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=RqjixCcJzh7f415gAflunYsJj46eShQlEq1XsrjULck=; b=I E3XwPw7g+b+srls84XDyvd1TKqkSZRuojYu5WlrBulo3e9LGB392lEf/33qoZQcKmU5wWwaT7QzQF 5ZnJJNSOjGeX7PYjwEs8QxNu5AtVlP22KFtEmzTIkBDkxS8UNv3kOvfSbOHt6PL3EihDoeTV6xptf IyLRyvUB0ritoQks=; Received: from mail-wr1-f51.google.com ([209.85.221.51]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1stSfZ-0004pE-8j for openvpn-devel@lists.sourceforge.net; Wed, 25 Sep 2024 14:07:06 +0000 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-374bd059b12so4117116f8f.1 for ; Wed, 25 Sep 2024 07:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1727273218; x=1727878018; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=RqjixCcJzh7f415gAflunYsJj46eShQlEq1XsrjULck=; b=IWm//dpagIaPSHBY7HVe9jHwwouXVdcVT+62SaZJKI02csnn50/qmeYVeXquoyyBpg FW4rMEhGQEXkM+FPdoSg+nMd2PxLj11JXf13pNc809sucaHBFWr5lQg5tmMXJIOXVXIX vLoaQPaeyjqp9eoF2deWAs/GscUJtNC/FCH/6T3uLovqjwgsI4Z8cZYvgsh2zLx7497U 45uh5mJ5fk3+4L6hcajyV7/iPeOH+TLhAvZeSB8G0S0a9uNnw9xW8tFfk/3FlAbJ3xiZ e0JZ5ckjMhTBehtaHLZ8iA1JnJGRrfXSLcZkeWLEJ3u7kSjlO5IxAVbizCMhmH+CuvEL RqSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727273218; x=1727878018; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RqjixCcJzh7f415gAflunYsJj46eShQlEq1XsrjULck=; b=DgfcagwHhwdsLBCHlDdrP0kHY7uDFnrasD8Hk3EBjyC8k/MhK+JZhCDTIgkrKwv2XQ j5/uS+O8L9E7Vrsfj9fSnpX9MDNV67qZSG9bdMsyDCcR5Ib6Fv1V8YaVzZeS97ttb5Ck Rjyxw9mcJFH/kIyqN3iVKcbmY8Iu8syPaFcwBrrWL/uR+tzuZubEUf08MhT+DYfalZQn hxIFkMqAVzyPXol0laI/s9U5ZXhVz9kXnw6yIbYXlqc6B4LHkZ4qdDAIrlyGVJXhkl7S rsDTeaL/vhNkYet2ybI1vRAnqFRVgyz4SJVwFgwDQuWrWAZOVwerFtLoPJiTDcLkHnQI qDxQ== X-Gm-Message-State: AOJu0YwBoCcEwDldutDUW8+Z0LPYoXRqAMD9GHhbFk/rzsgovnu05ipr JUpz9n65qnuUrg87YGm04CjYwkBs6Ax80fUmEF1f9U6+5RyJUfxtcGlN9l/ey3dsRCagAN1DT9F J X-Received: by 2002:a05:6000:11c8:b0:37c:ccbf:5902 with SMTP id ffacd0b85a97d-37cccbf5982mr437598f8f.4.1727273218349; Wed, 25 Sep 2024 07:06:58 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cbc2a8b55sm4119762f8f.17.2024.09.25.07.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 07:06:57 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Wed, 25 Sep 2024 14:06:57 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Ia020c696f63a2a317f001c061b2ab4da69977750 X-Gerrit-Change-Number: 771 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: ead7090b7e741f1a97586cbf5e29410f39733243 References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.0 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.51 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1stSfZ-0004pE-8j Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix check for struct cmsg not detecting the struct 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: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811177267423067182?= X-GMAIL-MSGID: =?utf-8?q?1811177267423067182?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/771?usp=email to review the following change. Change subject: Fix check for struct cmsg not detecting the struct ...................................................................... Fix check for struct cmsg not detecting the struct 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 --- M CMakeLists.txt 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/71/771/1 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)