From patchwork Mon Feb 6 11:22:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3051 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp3048983dyk; Mon, 6 Feb 2023 03:23:30 -0800 (PST) X-Google-Smtp-Source: AK7set/pljjleFK5WTAdkrsdzbPFtiLyTobYB+YZddAISMl6J8/wpDK2Va0d3r0ybOagGylrpnNI X-Received: by 2002:a62:1a8a:0:b0:598:b178:a3a9 with SMTP id a132-20020a621a8a000000b00598b178a3a9mr6907185pfa.6.1675682610756; Mon, 06 Feb 2023 03:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675682610; cv=none; d=google.com; s=arc-20160816; b=iN7H857WlPQx4FaoXPeM/x3cOLp3TSt6O2h0/VZstu8vUwz6d8LzQjF0XfzrEEOcth HNigZasuZoiJgubrtqUdGF5K3LipPsi8UDtM/05wTf7t0ARIxwMRVoEZICW+JJGDL66H GscyJGlqIm+nybt43TmODnvlw+RyRunuyQRV1aXLRB/kZbaWDiAnWpcgnlMXYzZFFeGw IthQweBLPeOGEDJZCepyVeo8wT6Ok7E5XpD8JR9q/ZFwiJ1uAIkGUYJcQCAbTbkMJzzU j9dIcf77QZDMEjgLCN8pmq7ILI5OjSk7y0CHpGdW3/F88xstsC4fZMZfO5Rq2uXUlIrd 6hMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=qsugpL+yQUHOUUEzkcMFI5aJWKXvWRyM9JWI+PzBVeo=; b=In2jSBD79YX8SdXohaynpRRtPaIwvBAXN8GsvYvtEtBI/4dk40MJiwfNr9pDf+Cetb h/cnhiweBfQ6WLpEbtnt1Ko0psPPuTHF3x0PQ2iYTsJStb/SnnjcMIY8hvhR0N9e2q3b UO7UojN4WZHHJ8te4m7+fRTc2vgAatNHKMg07ikTkwCkV6mEjXDmTpe1bRR7duGGYIHG FNO99zI7VfDgDhEmGNrkV0zSgEDWLrb6+8gSskmwV5LHyCjCZgldfGEwHADrTi1bkGzJ LODiLlIsY/yktC/D7HTaLthVScRsCMa7LvU48SywqA4Dlm2TRx0aPJxKZ4qn5vOfXRV3 mb9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="GXaO/+tt"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="kvRtg/fX"; 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 Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id q15-20020a056a00150f00b0059393d77c1bsi14397441pfu.219.2023.02.06.03.23.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2023 03:23:30 -0800 (PST) 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="GXaO/+tt"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="kvRtg/fX"; 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 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pOzZy-00071x-Qy; Mon, 06 Feb 2023 11:22:34 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pOzZx-00071g-2u for openvpn-devel@lists.sourceforge.net; Mon, 06 Feb 2023 11:22:32 +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=lLzD39YDe6HY0NhAO7r6svcX+y5H8lzyH6yTh2Sth8Q=; b=GXaO/+ttoXYddWPbyiVM3almpf ehQTVumAyuy2lK+qbZMxhlj2NzUFf9zcE3L7/6F1MnLICSSMbmAAjupXxDQCGYuHJ2b+UNb1FMjaF 61qbqZRx4M2asCoMrpiWGvnTbqFV6SW6OMs26tBbO4ZZfBT94k6XULTkwnwox7430wNo=; 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=lLzD39YDe6HY0NhAO7r6svcX+y5H8lzyH6yTh2Sth8Q=; b=kvRtg/fXY7UtrA6qtA9LRNMe7H OrOMtPHE0PmxvLDE4auUMED/8l5N4mZgbiw8ZslNjhs9g8JM6xWuehCDumwZPi9XKs4qo9SNUCzw0 yY6G9knvYbYdWUM45uiPrCvLBXeBrwJti1h4OsqVO1wZEv3AQON/QtW2PuCP7TpV+soE=; Received: from mout-p-201.mailbox.org ([80.241.56.171]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pOzZt-0001lM-WD for openvpn-devel@lists.sourceforge.net; Mon, 06 Feb 2023 11:22:32 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4P9P4C5YhJz9sWL for ; Mon, 6 Feb 2023 12:22:19 +0100 (CET) From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Mon, 6 Feb 2023 12:22:18 +0100 Message-Id: <20230206112218.51430-1-frank@lichtenheld.com> In-Reply-To: <20230203165529.125771-1-frank@lichtenheld.com> References: <20230203165529.125771-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4P9P4C5YhJz9sWL X-Spam-Score: -0.7 (/) 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: Automatically disabled when - iproute2 is enabled (Don't want to force people specifying --disable-dco explicitely) - libnv is missing on FreeBSD (FreeBSD version too old anyway) Will still error out if libnl-genl is missing on Linux to make people aware of new dependency. Content analysis details: (-0.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.171 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pOzZt-0001lM-WD Subject: [Openvpn-devel] [PATCH v2] configure: enable DCO by default on FreeBSD/Linux 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?1756829740649023698?= X-GMAIL-MSGID: =?utf-8?q?1757080569642911376?= Automatically disabled when - iproute2 is enabled (Don't want to force people specifying --disable-dco explicitely) - libnv is missing on FreeBSD (FreeBSD version too old anyway) Will still error out if libnl-genl is missing on Linux to make people aware of new dependency. Signed-off-by: Frank Lichtenheld --- configure.ac | 78 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 17 deletions(-) v2: error out when libnl-genl is missing as discussed with ordex on IRC. diff --git a/configure.ac b/configure.ac index 91500087..acfa4bc1 100644 --- a/configure.ac +++ b/configure.ac @@ -144,14 +144,27 @@ AC_ARG_ENABLE( AC_ARG_ENABLE( [dco], - [AS_HELP_STRING([--enable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=no@:>@])], + [AS_HELP_STRING([--disable-dco], [enable data channel offload support using the ovpn-dco kernel module (always enabled on Windows) @<:@default=yes@:>@])], , - [enable_dco="no"] + [ + case "$host" in + *-*-linux*) + enable_dco="auto" + ;; + *-*-freebsd*) + enable_dco="auto" + ;; + *) + # note that this does not disable it for Windows + enable_dco="no" + ;; + esac + ] ) AC_ARG_ENABLE( [iproute2], - [AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 @<:@default=no@:>@])], + [AS_HELP_STRING([--enable-iproute2], [enable support for iproute2 (disables DCO) @<:@default=no@:>@])], , [enable_iproute2="no"] ) @@ -534,7 +547,7 @@ AC_CHECK_DECLS( , [[${SOCKET_INCLUDES}]] ) -AC_CHECKING([anonymous union support]) +AC_MSG_CHECKING([anonymous union support]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ @@ -769,28 +782,59 @@ PKG_CHECK_MODULES( ) -if test "$enable_dco" = "yes"; then +if test "$enable_dco" != "no"; then + enable_dco_arg="$enable_dco" + if test "${enable_iproute2}" = "yes"; then + AC_MSG_WARN([iproute2 support cannot be enabled when using DCO]) + enable_dco="no" + fi + case "$host" in + *-*-linux*) dnl dnl Include generic netlink library used to talk to ovpn-dco dnl - case "$host" in - *-*-linux*) PKG_CHECK_MODULES([LIBNL_GENL], [libnl-genl-3.0 >= 3.4.0], [have_libnl="yes"], - [AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer])] + [ + AC_MSG_ERROR([libnl-genl-3.0 package not found or too old. Is the development package and pkg-config installed? Must be version 3.4.0 or newer for DCO]) + ] ) - - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" - - AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) - AC_MSG_NOTICE([Enabled ovpn-dco support for Linux]) + if test "$enable_dco" = "no"; then + if test "$enable_dco_arg" = "auto"; then + AC_MSG_WARN([DCO support disabled]) + else + AC_MSG_ERROR([DCO support can't be enabled]) + fi + else + CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" + LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + + AC_DEFINE(ENABLE_DCO, 1, [Enable shared data channel offload]) + AC_MSG_NOTICE([Enabled ovpn-dco support for Linux]) + fi ;; *-*-freebsd*) - LIBS="${LIBS} -lnv" - AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD]) - AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD]) + AC_CHECK_LIB( + [nv], + [nvlist_create], + [ + LIBS="${LIBS} -lnv" + AC_DEFINE(ENABLE_DCO, 1, [Enable data channel offload for FreeBSD]) + AC_MSG_NOTICE([Enabled ovpn-dco support for FreeBSD]) + ], + [ + enable_dco="no" + AC_MSG_WARN([Name/Value pair library not found.]) + ] + ) + if test "$enable_dco" = "no"; then + if test "$enable_dco_arg" = "auto"; then + AC_MSG_WARN([DCO support disabled]) + else + AC_MSG_ERROR([DCO support can't be enabled]) + fi + fi ;; *-mingw*) AC_MSG_NOTICE([NOTE: --enable-dco ignored on Windows because it's always enabled])