From patchwork Tue Feb 7 13:20:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3055 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp3946807dyk; Tue, 7 Feb 2023 05:21:52 -0800 (PST) X-Google-Smtp-Source: AK7set90bm3jCTYzVIkBa6hdpqJ5oPy5k/jR7fcaktnwi+9QrC5bqbIS90z5LLbGDKAvANUztqQs X-Received: by 2002:a05:6870:c6a5:b0:163:5c0b:239e with SMTP id cv37-20020a056870c6a500b001635c0b239emr1471546oab.5.1675776112387; Tue, 07 Feb 2023 05:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675776112; cv=none; d=google.com; s=arc-20160816; b=OJ9qZjTOLAQKOWOhEQ1cYNJZDrhSA7ZKqmdjfwNolmCxhmbw3dX/3onNlARdidKLAO QLwyDwXKD0LYFU4nhVCFxyah6iFe8osY1XfNIuYtfGgOQThCheI/sjf2MzEEN7nKjRt+ h2OfU8yKbq5VVM6NZPJBOvGlp02fGx26V4d3GVDQYwSeKJH4ovNTRHr29hWtGvKsoJC3 IO9TeskGVzhKMHLtrPFb1Vqiq1kiiq20YCBh2G1QS9QO1vlO/brSy/nGju/eijkycu6/ L06P/V2tchuQ+1rmMttkjeW5rxZbo0MqqV0N7ug2jr+lz5dL5/xV5whPSJU1XWraCeVJ dhRA== 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=lwzZilGd8RQSy/rohYq2J0InsKA/c145dH51vpdQujU=; b=HEOhnnC/O2ndFlJdVatyFVkN1DtPUltl3sE/V57BUdH6Le2n9Ns6/FHZLtSgKDLbdg Dgb02lukZJMLR5APEjeXvnMVRfssKfcchYf9UaxBOCxZ+iOjHfrcZ8WpEZTX5Clk0gVR WL9zr0YteUVrpCJ21mW7tMIaZMmvDke5IjPlc3ft/PP3gy+bb/sFI8kE1/V6wseTNvqg UcWoTPKN1DXGIEn8JLBpuy5b1+YRhsQqorC7VrXLFT6AgIRym9PDw2cpMneouZeW0tPA /cjMEyOBGz3t3XStAsRCrgyorn6j4pwj6Ya0GqLYsEKX2Gq/McOiud8XYCROstqDUhUE 5gFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Dr+6J+fJ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eIxNdRrM; 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 i1-20020a544081000000b00369c655a07csi13096439oii.139.2023.02.07.05.21.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2023 05:21:52 -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=Dr+6J+fJ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=eIxNdRrM; 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-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pPNu7-0003wN-GS; Tue, 07 Feb 2023 13:20:58 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pPNtw-0003w5-Km for openvpn-devel@lists.sourceforge.net; Tue, 07 Feb 2023 13:20:47 +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=V+PKsp/0eum5iaWb141yWM1HXZ8C3JBicfGmW1u9AZI=; b=Dr+6J+fJ96C2JhMoRzccq0h0pT kVilEDyQow7YKKXOJjqL9ZtkNZy8H4B1VEl+hxFMcgbzy6DWA3TNJ4Rs9ifWw0XKr/iaNHNgp5Ax0 ry0z55BnClOrX3Irn+mqsfY5QiTEALGkor8z3aaGpN9AfBaB0h2OesBqw+3YTKsnRfoQ=; 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=V+PKsp/0eum5iaWb141yWM1HXZ8C3JBicfGmW1u9AZI=; b=eIxNdRrML8MLRSmKFGU/ChcOI4 hpUArRcUD0r18rnSQfMr36otZd6t0r0oCZwzcZUpAoEqfuMpcffSmIPKvLBwmoEt3Z3XgzHaUBThz T3wCKZcuCosxn4dMwI9MWdn797TLT0EG56OYl1qRUUhjh/drU1ZJM87RuaW5CP40g2YI=; Received: from mout-p-101.mailbox.org ([80.241.56.151]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pPNtn-0001yK-BE for openvpn-devel@lists.sourceforge.net; Tue, 07 Feb 2023 13:20:44 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (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-101.mailbox.org (Postfix) with ESMTPS id 4PB3f33z1lz9sb9 for ; Tue, 7 Feb 2023 14:20:27 +0100 (CET) From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Feb 2023 14:20:26 +0100 Message-Id: <20230207132026.41580-1-frank@lichtenheld.com> In-Reply-To: <20230206112218.51430-1-frank@lichtenheld.com> References: <20230206112218.51430-1-frank@lichtenheld.com> MIME-Version: 1.0 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 the 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.151 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: 1pPNtn-0001yK-BE Subject: [Openvpn-devel] [PATCH v3] 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?1757178612795287409?= 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 the new dependency. Signed-off-by: Frank Lichtenheld Acked-by: Selva Nair Acked-by: Antonio Quartulli --- configure.ac | 82 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 19 deletions(-) v2: error out when libnl-genl is missing as discussed with ordex on IRC. v3: - improvements to the messages, suggested by Selva - further improvements to the default specification, trying to make it clear - if enabling iproute2, do not test for libnl-genl diff --git a/configure.ac b/configure.ac index 78c99740..ba33ccd8 100644 --- a/configure.ac +++ b/configure.ac @@ -146,14 +146,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], [disable data channel offload support using the ovpn-dco kernel module @<:@default=yes@:>@ on Linux/FreeBSD, can't disable on Windows])], , - [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"] ) @@ -536,7 +549,7 @@ AC_CHECK_DECLS( , [[${SOCKET_INCLUDES}]] ) -AC_CHECKING([anonymous union support]) +AC_MSG_CHECKING([anonymous union support]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ @@ -771,28 +784,59 @@ PKG_CHECK_MODULES( ) -if test "$enable_dco" = "yes"; then -dnl -dnl Include generic netlink library used to talk to ovpn-dco -dnl +if test "$enable_dco" != "no"; then + enable_dco_arg="$enable_dco" + if test "${enable_iproute2}" = "yes"; then + AC_MSG_WARN([DCO cannot be enabled when using iproute2]) + enable_dco="no" + fi case "$host" in *-*-linux*) - PKG_CHECK_MODULES([LIBNL_GENL], + 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 + dnl + dnl Include generic netlink library used to talk to ovpn-dco + dnl + 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])] - ) - - CFLAGS="${CFLAGS} ${LIBNL_GENL_CFLAGS}" - LIBS="${LIBS} ${LIBNL_GENL_LIBS}" + [ + 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]) + 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])