From patchwork Thu Jun 23 22:37:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2521 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.30.191.6]) by backend41.mail.ord1d.rsapps.net with LMTP id 6AhPCyd4tWKNTwAAqwncew (envelope-from ) for ; Fri, 24 Jun 2022 04:39:03 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director14.mail.ord1d.rsapps.net with LMTP id iM0cCyd4tWI+aAAAeJ7fFg (envelope-from ) for ; Fri, 24 Jun 2022 04:39:03 -0400 Received: from smtp40.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTPS id GOYUCyd4tWKYIwAAAY1PeQ (envelope-from ) for ; Fri, 24 Jun 2022 04:39:03 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp40.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 19681836-f399-11ec-b1dc-525400f204c2-1-1 Received: from [216.105.38.7] ([216.105.38.7:40850] helo=lists.sourceforge.net) by smtp40.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 3F/6D-02414-62875B26; Fri, 24 Jun 2022 04:39:02 -0400 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.94.2) (envelope-from ) id 1o4epK-0001Ym-CH; Fri, 24 Jun 2022 08:38:06 +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.94.2) (envelope-from ) id 1o4epI-0001YO-Jv for openvpn-devel@lists.sourceforge.net; Fri, 24 Jun 2022 08:38:04 +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:Cc:To:From:Sender:Reply-To: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=4BdxSNVW4t5kSZVkjP0FE3AUE+R3z7OBU5B5LckKgG4=; b=hCLhrijHjiqq6wplObl73nt6Y0 k0siixeNNOsRPicVwc4VJHKSGz8kVSzRTorQTyamKXkGbb9EnGg6GzWx0QkFqGJ2M+E5WHyl3xX1U nuW2zmITkiuC2yxdvkltGHMeyr2l1amxvyeZwysk9Iw51LZC/DbPkoY+HzJ+7ojN1LsA=; 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:Cc:To:From:Sender:Reply-To: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=4BdxSNVW4t5kSZVkjP0FE3AUE+R3z7OBU5B5LckKgG4=; b=h2T83ibo0/uHlqu/ZJWJnneSdv wcsCZxt4xRXmnTHYwzbWtAoTP17Dp5At7oxSwlAjS/tejHNE/GBC0iMRv9zhBrvs40E2budksDalD eueyNVk8cn0IbU7rS3AnFZ3kiwkV883DVUiIW6nszIqf46u1G6iitq8k3xguv1hQbUZE=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1o4epH-00C2Oi-Ae for openvpn-devel@lists.sourceforge.net; Fri, 24 Jun 2022 08:38:04 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 24 Jun 2022 10:37:46 +0200 Message-Id: <20220624083809.23487-3-a@unstable.cc> In-Reply-To: <20220624083809.23487-1-a@unstable.cc> References: <20220624083809.23487-1-a@unstable.cc> MIME-Version: 1.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: Signed-off-by: Antonio Quartulli --- src/openvpn/options.h | 20 ++++++++++++++++++++ src/openvpn/tun.h | 1 + 2 files changed, 21 insertions(+) diff --git a/src/openvpn/options.h b/src/openvpn/options.h index c2937dc3..8152e755 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -879,4 +879,24 @@ void options_string_import(struc [...] 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: 1o4epH-00C2Oi-Ae Subject: [Openvpn-devel] [PATCH 02/25] dco: add helper function to detect if DCO is enabled or not 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/options.h | 20 ++++++++++++++++++++ src/openvpn/tun.h | 1 + 2 files changed, 21 insertions(+) diff --git a/src/openvpn/options.h b/src/openvpn/options.h index c2937dc3..8152e755 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -879,4 +879,24 @@ void options_string_import(struct options *options, bool key_is_external(const struct options *options); +#if defined(ENABLE_DCO) && defined(TARGET_LINUX) + +/** + * Returns whether the current configuration has dco enabled. + */ +static inline bool +dco_enabled(const struct options *o) +{ + return !o->tuntap_options.disable_dco; +} + +#else /* if defined(ENABLE_DCO) && defined(TARGET_LINUX) */ + +static inline bool +dco_enabled(const struct options *o) +{ + return false; +} + +#endif #endif /* ifndef OPTIONS_H */ diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index 60cd574d..5fcea590 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -139,6 +139,7 @@ struct tuntap_options { struct tuntap_options { int txqueuelen; + bool disable_dco; }; #else /* if defined(_WIN32) || defined(TARGET_ANDROID) */