From patchwork Fri Aug 12 03:06:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2663 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id uAYHOuRQ9mI9NQAAIUCqbw (envelope-from ) for ; Fri, 12 Aug 2022 09:08:52 -0400 Received: from proxy2.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id EE3rOeRQ9mI1YQAA91zNiA (envelope-from ) for ; Fri, 12 Aug 2022 09:08:52 -0400 Received: from smtp32.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1d.rsapps.net with LMTPS id IB27OeRQ9mL/cwAAfawv4w (envelope-from ) for ; Fri, 12 Aug 2022 09:08:52 -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: smtp32.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=fail (p=none; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: e9833f1a-1a3f-11ed-b53d-52540099eaf5-1-1 Received: from [216.105.38.7] ([216.105.38.7:49866] helo=lists.sourceforge.net) by smtp32.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 07/AD-03965-4E056F26; Fri, 12 Aug 2022 09:08:52 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oMUNQ-0000sn-0J; Fri, 12 Aug 2022 13:07:01 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oMUMw-0000sN-7u for openvpn-devel@lists.sourceforge.net; Fri, 12 Aug 2022 13:06:30 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GglLMJtjukOPYydKNVuMgtLBsID9ETVW01J+7wpR2Qk=; b=CvTTRAL2mjWLguNvzAigTMvzaM opqmiF+5RrqM80bOLpfElpb+zj6tB6V7MA3l53CxKZRQ90zYw5X2YNfsNL7O59u9KAV7YZiC7ZhzX BgxZFH2WYcaDVoA/mzyL6xqC4XmLoAq45pjarLFFg8oA7ywUa/fTxBLeTuizwTgJ5iRw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=GglLMJtjukOPYydKNVuMgtLBsID9ETVW01J+7wpR2Qk=; b=Q T6LFj8km8GH9Etsrf6AKv0DeaymAz9qEfuR3bmwx7W/L7o8PCINrmarQlrZcl/n28DXBwIpgodGWQ 68ybX9EuN6qrFXns5faVIDxazhZ9hJpNfP3DlVBjZ0mOiw2+fYESztmss1Onj7VBDXOcZBfX3+YUp k2B9ag+lyT5S8nTM=; 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 1oMUMs-00DFVO-5n for openvpn-devel@lists.sourceforge.net; Fri, 12 Aug 2022 13:06:29 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 12 Aug 2022 15:06:47 +0200 Message-Id: <20220812130657.29899-1-a@unstable.cc> MIME-Version: 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: This patchset is essentially a resending of the patches that were already on the mailing list, but were not appled yet. Some of them required extra work, while some required reordering. To make things simpler, I am resending them as a patchset, with some extra bonus patches too. Content analysis details: (1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1oMUMs-00DFVO-5n Subject: [Openvpn-devel] [PATCH v100 00/10] ovpn-dco: leftovers 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 This patchset is essentially a resending of the patches that were already on the mailing list, but were not appled yet. Some of them required extra work, while some required reordering. To make things simpler, I am resending them as a patchset, with some extra bonus patches too. I am going with v100 to kinda restart from zero, without mixing up existing versions of these patches. Enjoy! Antonio Quartulli (10): do_open_tun: restyle "can preserve TUN" check dco-win: introduce low-level code for handling ovpn-dco-win in Windows dco-win: add platform dependant check on incompatible options dco-win: implement ovpn-dco support in P2P Windows code path dco-win: add documentation to README.dco.md dco-win: update GH Actions config file dco-win: ensure the DCO API is not used when running on Windows ovpn-dco: print some netlink messages to debug level dco: properly name variables dco: move message to DCO debug level and reword a bit .github/workflows/build.yaml | 7 +- README.dco.md | 11 +- config-msvc.h | 2 + configure.ac | 9 +- dev-tools/special-files.lst | 1 + src/openvpn/Makefile.am | 4 +- src/openvpn/dco.c | 34 ++- src/openvpn/dco_internal.h | 1 + src/openvpn/dco_linux.c | 5 +- src/openvpn/dco_win.c | 397 ++++++++++++++++++++++++++++ src/openvpn/dco_win.h | 57 ++++ src/openvpn/forward.c | 31 ++- src/openvpn/init.c | 307 +++++++++++---------- src/openvpn/openvpn.vcxproj | 3 + src/openvpn/openvpn.vcxproj.filters | 9 + src/openvpn/options.c | 28 +- src/openvpn/options.h | 15 +- src/openvpn/ovpn-dco-win.h | 108 ++++++++ src/openvpn/socket.c | 93 ++++++- src/openvpn/socket.h | 25 +- src/openvpn/tun.c | 56 +++- src/openvpn/tun.h | 77 ++++-- 22 files changed, 1059 insertions(+), 221 deletions(-) create mode 100644 src/openvpn/dco_win.c create mode 100644 src/openvpn/dco_win.h create mode 100644 src/openvpn/ovpn-dco-win.h