From patchwork Thu Nov 21 18:07:52 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: 3954 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1b0d:b0:5db:37e7:e801 with SMTP id cv13csp501338mab; Thu, 21 Nov 2024 10:08:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXliGwuuACtxP+stouhvvbBloXZzZRIU+7OFeeQJeRfCCZKYAo3bcnqnSGkQiwWYqne9E5QggwOBUE=@openvpn.net X-Google-Smtp-Source: AGHT+IHj40IV9RImUu2pDXeCVk+u7pxYI2IrYcKvQ1imoPsztG9Z8wSWhiLMZXJjYQZZHKxYmfza X-Received: by 2002:a05:6870:498f:b0:278:2028:8e87 with SMTP id 586e51a60fabf-2971e2b17e1mr122787fac.3.1732212497557; Thu, 21 Nov 2024 10:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732212497; cv=none; d=google.com; s=arc-20240605; b=d30yqs4tRaMSEhQpI+kJJtbifjq6pu7hwOX6rlrfIJMmw3zWqsIhlGE2uxFPiqwpKW 4cn8QgBx53jfpkPFT2UOrmkwidfxQSyT5f12zpwsD2BLXPw+v+AajoJZuG13/cMy3pM0 m4vID3ENqu2zNROgjaudXPNXm2+AJI0LlDhiVWKhoEZTeRE+LjyAfyOw07P5fwTZt8xs /25Y3ZzbYngl3g70LwQZj85HZP23CQ5U8sEqKsGvDsXTeIdU9mhtxzrc4RvVN0v7t3oG iFzXdxBCfY8JyaHWDON8KAyBMMMGXDhHCZZ2bqygGqYPS2HDhxVkMrSX4zERwtn9UNAU tazg== 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=oRRPyrklYGAgdoBYMPv27rFoev/2V/zoCaMckiYF1qo=; fh=U7wEyxtwz2o5+UdevFSA47vNeG9knhWH0KV//QhD5a0=; b=ffuaaVKMHEuFG6c+MeeApbc/bYHRLkj6629OqHeTWiqYzoTwOB8Zu9po6hK2FgfFvT sZvq8Vc06gXftlD7/8ytlt+f5c/QZxu7kUH8tpCQew56YLxEPu06lkbMaLBmV7OWwvP1 /ghH4khKLWmERgoD+WteDW2Wp6rgH6DI3r0Pul3LFTHDeKGqG+L9I8JfijFmpZyN0H22 sqpZ0NY26rMCrs1vxOHE+5BpwnTidzke7kHmxxaLjUxOwwXE3GAGhwhTKdEmevy/0JSr hzvydcc+GM6qGuGaBuZ6g8sIRzFfzEHa8ICR+7LfgzeTcLhj+i5nVBk0ruoXdPln7d6m wWBg==; 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=H50QoTI4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Po4Ua4Mo; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HNdF7Bbb; 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 46e09a7af769-71c03743506si117001a34.36.2024.11.21.10.08.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2024 10:08:17 -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=H50QoTI4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Po4Ua4Mo; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=HNdF7Bbb; 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-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tEBb8-0000mn-3F; Thu, 21 Nov 2024 18:08:10 +0000 Received: from [172.30.29.66] (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 1tEBb6-0000ma-QT for openvpn-devel@lists.sourceforge.net; Thu, 21 Nov 2024 18:08:08 +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=mNOEYQf8+hRHm40uaykF3h4IX4Fei1Mj0fxjDCi99b0=; b=H50QoTI4G0xoSJzM7jrmF4iayX XdMASKHbsNl7DVMPGmUrwPPDs4nNBdsxQPLNUy7kNmB7ct/hav5RGUdQSiXBpqhvzVGD7uf7ZUg6Q N93p5mmf/a6LsiwDx6plxdkZeI56/aT3Y8LmuDp6Wk6TCss9VMAqv/yOXo1ea80PSmdU=; 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=mNOEYQf8+hRHm40uaykF3h4IX4Fei1Mj0fxjDCi99b0=; b=P o4Ua4MoNQzDjEkgEhKXsjBu3+LTsOfiTussp77Wsls35vhkiM/3amsLRpyycAYtMdUtOGtZNAzcHB nIiek7ckMytxpLQa8hC0b1Zj61D/dv8faaDLEooy14Hnikt01omySQx41omgwXY2EHE/S9yfRG4JU SSz7r8wmMAnKg0co=; Received: from mail-lj1-f177.google.com ([209.85.208.177]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1tEBb5-0004Sw-TA for openvpn-devel@lists.sourceforge.net; Thu, 21 Nov 2024 18:08:08 +0000 Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2fb51e00c05so22836771fa.0 for ; Thu, 21 Nov 2024 10:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1732212474; x=1732817274; 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=mNOEYQf8+hRHm40uaykF3h4IX4Fei1Mj0fxjDCi99b0=; b=HNdF7BbbQR4Tb1M5ubwGxeAFdvlDoS6zIBH/8sAhrjgRZaqe6tj0YqoMDRWZ6DPSjP QSeoGgQ0vYuxw5z3HuAC+YlEq574EqEpDTpJijbeMWL7fEP88261Sqftfkcm3gEXp2CO 6RaBrDEbBz39qInNLPPZWX72TQbVFYkBEqfNZcNEB84zZsadH/uB/LHQ3LcYjKvawlEm V+HTKxVOF8EB4A16IFtJcEItCx+zkTw86BMQilvUm4iyOsde9anypOlwKcQ30Ox2eAYc Q0bmNvW84639wmvEWq5746aafI2oDOpqK42IQvn8mjFyO1+PKyfPuadbo0z6LCKdYgEI +qFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732212474; x=1732817274; 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=mNOEYQf8+hRHm40uaykF3h4IX4Fei1Mj0fxjDCi99b0=; b=scEDIKD4kPYMc19oZM+6xcUrReUk3va0AWwc0GLCXaUIWdig4MH3hsPKNMMN8V0y6N Vjit/1da2USuJ5iq1WjQxk4mIDENrvcEvrLD5dgYtFfUAzldYXyEyip3Pp9WKMl+nAVe e3fEysLoOzKpCk3LKhLVksnf6EnSrqKJapKDGO+Fx6JGHxVvkzfxzgXZqV+hValwPNOg 7mU7Wvabg2pW+ZG/BbuRKgQV2HLLLD9rW8rtFQIKe8K/yGIlAwA+9yti4bdiHyiPFj3z sdVpYn8M94AlnPLL1erT5l5ssHthQdc29f+Js7osoSnOPZ/oGs1O4Awic3obKGLWVJnz fNjQ== X-Gm-Message-State: AOJu0YzvWhwAyNW3Ljjtipb8avHUhXDOmxqSiyDRGpytddbl4bdsPre6 LPAsqBRQEF6LUfIYzLO5xze/I7aISVnJ2yzMYJ14+RzizEkMi1ow9MqefssW2yTitumdaeK+OvC T X-Gm-Gg: ASbGncvUjSYRzT4ISpz37kjfNWVdDHMdBt/IkVOvEQiHbZAvdeIGRGSEk/2gkMG1iS2 /FA6Daell/3tQ0E57K6LW+0WWqrzC1DYqJCYdRl8vXV37EZhK4vSNq1Ls87mOfKZmWG9tPukniC AoEWmNkq59eru0R+JiAPamQshakYRWUy8mSzLS7yYluCU4npgxvHXETaJ3KhJ+yD7pvOV3pw7kB bJ364SwX8PqjSbLa/pJv4xNdjQTPFoTgl5ksACpo7tL1dtWXzPUnGh/1A5c94QdBxoVK0v060A9 L9Fgn5cSduqY+OTEGEmMKYfwr29vrrIJ61oqg6/FwQ== X-Received: by 2002:a2e:be9e:0:b0:2ff:59dd:9242 with SMTP id 38308e7fff4ca-2ff8dcb1d15mr79379161fa.35.1732212473965; Thu, 21 Nov 2024 10:07:53 -0800 (PST) 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 5b1f17b1804b1-433cde8c862sm283505e9.29.2024.11.21.10.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 10:07:53 -0800 (PST) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 1 Date: Thu, 21 Nov 2024 18:07:52 +0000 To: plaisthos , flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: Iea4538cee075d50de836d1ef7652985186b2527c X-Gerrit-Change-Number: 812 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 5f8425324eff155b06488da2b0808f8a09c11eea References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -0.2 (/) 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, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.208.177 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [209.85.208.177 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.177 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.177 listed in list.dnswl.org] 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_AU Message has a valid DKIM or DK signature from author's domain -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 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: 1tEBb5-0004Sw-TA Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco-win: disable DCO for server mode and unsupported driver version 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: lstipakov@gmail.com, 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?1816356451710972980?= X-GMAIL-MSGID: =?utf-8?q?1816356451710972980?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/812?usp=email to review the following change. Change subject: dco-win: disable DCO for server mode and unsupported driver version ...................................................................... dco-win: disable DCO for server mode and unsupported driver version Server mode requires multipeer functionality, which is available starting from dco-win version 2. Disable DCO for older drivers if mode server is specified. Change-Id: Iea4538cee075d50de836d1ef7652985186b2527c Signed-off-by: Lev Stipakov --- M src/openvpn/dco.c M src/openvpn/dco_win.c M src/openvpn/dco_win.h 3 files changed, 20 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/12/812/1 diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index dcc80d3..4195cf8 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -43,6 +43,10 @@ #include "tun.h" #include "tun_afunix.h" +#if defined(_WIN32) +#include "dco_win.h" +#endif + #ifdef HAVE_LIBCAPNG #include #endif @@ -255,18 +259,18 @@ return false; } -#if defined(TARGET_FREEBSD) +#if defined(TARGET_FREEBSD) || defined(TARGET_WIN32) if (!proto_is_udp(ce->proto)) { - msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD."); + msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD and Windows."); return false; } #endif #if defined(_WIN32) - if (!ce->remote) + if (!ce->remote && !dco_win_supports_multipeer()) { - msg(msglevel, "NOTE: --remote is not defined, disabling data channel offload."); + msg(msglevel, "NOTE: --remote is not defined. This DCO version doesn't support multipeer. Disabling Data Channel Offload"); return false; } #endif @@ -331,9 +335,9 @@ } #if defined(_WIN32) - if (o->mode == MODE_SERVER) + if ((o->mode == MODE_SERVER) && !dco_win_supports_multipeer()) { - msg(msglevel, "--mode server is set. Disabling Data Channel Offload"); + msg(msglevel, "--mode server is set. This DCO version doesn't support multipeer. Disabling Data Channel Offload"); return false; } diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 27182b5..3bc123b 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -523,4 +523,11 @@ } } +bool +dco_win_supports_multipeer() +{ + OVPN_VERSION ver = { 0 }; + return dco_get_version(&ver) && ver.Major >= 2; +} + #endif /* defined(_WIN32) */ diff --git a/src/openvpn/dco_win.h b/src/openvpn/dco_win.h index 4883629..a28436c 100644 --- a/src/openvpn/dco_win.h +++ b/src/openvpn/dco_win.h @@ -48,6 +48,9 @@ void dco_start_tun(struct tuntap *tt); +bool +dco_win_supports_multipeer(); + #else /* if defined(ENABLE_DCO) && defined(_WIN32) */ static inline void