From patchwork Wed Apr 2 13:21:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4209 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:6c6:b0:60a:d70a:d3c7 with SMTP id j6csp3568354maw; Wed, 2 Apr 2025 08:26:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX6aUzIdvVLQhlFj/l+4n+/T3xv7iFKM/cUfdEsqXF4j59zSw0FzIX9wDcgPzk7Y7+QzKH8U1hKo3g=@openvpn.net X-Google-Smtp-Source: AGHT+IFfm/rRfEuIXdtHzCWhCcZFkbY2PjsY5XNmWYcWO6JjdzjN91NVqVX4W2uqRC1CBvPdg3N+ X-Received: by 2002:a05:6602:3787:b0:85b:4154:7906 with SMTP id ca18e2360f4ac-85ec8ea5cd5mr968698439f.5.1743607609549; Wed, 02 Apr 2025 08:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743607609; cv=none; d=google.com; s=arc-20240605; b=U/MtsfVLWP9P2kvU3dkRgPnT/M1nP63ysEWsqKyEed43MYtUriUaXyb86WF0K44v81 aHgK/NYDLgpyLEMt1VspyAAifib6fTWZ6PLA+NBfrvY9xz75PadJ3XGx6x3GI7Y71p9J YyOuYtkX8CqI2j4dVYv3Tgz9ZqYQ7vv8j0+/uL3j4qH3DDU7tzdOc0WCGS4OHZdyFCrb AT9KW2AXE8WcNtHF230v0fOr7FwhCBEoOb5Q90DJkJLjlSWsM5RBYFDhao92mIINukJY 1rmKumGkIHRlUIovFHQTHR7mhy40F6Ti7qiWpolv9sv107M3o8kMzuUc6ghfLFM0OQQ+ 47mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=kcvih4zDgX5Om4aiI6RLWLNQEmS0zkHJ/tsTjBUSg/0=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=eM+7EnAifB91jIyFrQ4jUaOv9v87CWzUhQncmrg1ZfGkE9iX03o5UO72RcuQyKI6En Kr5X7n2xci3mGWoCMvmY58pfMtt/qlp1kIUMlcWoXJF82kgfST0CGesVvkA8MHTQ9UNO tIK6tBi5mVf4EjGDrz6EA2lU1h/gdW6KYcu2NNrTpmrPtXDgLXYEzBHcXNeMSm2aAugC bxg/kI2FHB4CP2P6bxxHl4vT5EROimRDy/ISnd6gJSnN9EkGoiuSsGJNPL5EiIadnLhA C/bAGBu8zb5GFTMFXkOWxI9DEu5e1BfrBYMvnZHpjGvOv5JDGsuGUoPB4S1POtQ3OHMY tTMg==; 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=eQjRcNPV; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=JjYlmpTS; 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=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4f4647650d8si14726739173.54.2025.04.02.08.26.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Apr 2025 08:26:49 -0700 (PDT) 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=eQjRcNPV; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=JjYlmpTS; 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=muc.de Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tzzzL-0000vm-39; Wed, 02 Apr 2025 15:26:46 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tzzzJ-0000vc-QX for openvpn-devel@lists.sourceforge.net; Wed, 02 Apr 2025 15:26:45 +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=Op5Xpucywr3DDCnFM2GAB5vUyRVPYAcnKj/IQlceGi4=; b=eQjRcNPVqzNGFQAetCjQiJxkvz KzENxSZe95+R1rpAyPm7ugVYiMWlU5Ca/X377/4Yb5+YsyPtNl0FRsVLBfrtStA78pzKdL2hNUkIC fGAzH9h/pl8wxN+7LrzqpopvldJTUvZgrlkyb4mVtDAhDr7q+rrFRuudyuK8+GyuSXC0=; 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=Op5Xpucywr3DDCnFM2GAB5vUyRVPYAcnKj/IQlceGi4=; b=JjYlmpTSCtk7UvySkADi9MC6FP 6sr6yRL+MedePFoDrPNoT9YpC/hQZQEVA293eWB1PDSf6e9wE1X16hckhYXpM9iXCulOk19G5Q2IF FbebtNBy0oTdPNv0Uv/fG7o/nyspMQY76TSd0c2wkUcfutk6YVnlb5DtNj0TNBkwF7Qo=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tzzz3-0005pB-6M for openvpn-devel@lists.sourceforge.net; Wed, 02 Apr 2025 15:26:45 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 532DLnss018917 for ; Wed, 2 Apr 2025 15:21:49 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 532DLnqZ018916 for openvpn-devel@lists.sourceforge.net; Wed, 2 Apr 2025 15:21:49 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 2 Apr 2025 15:21:42 +0200 Message-ID: <20250402132148.18810-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.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: From: Gianmarco De Gregori FreeBSD-DCO does not support TCP as transport protocol so in order to be able to use DCO in a multi-socket environment we need to check the local_list entries and disable DCO if any of the listening s [...] Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] 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. [193.149.48.174 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1tzzz3-0005pB-6M Subject: [Openvpn-devel] [PATCH v1] Fix FreeBSD-DCO and Multisocket interaction 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?1828305092681311755?= X-GMAIL-MSGID: =?utf-8?q?1828305092681311755?= From: Gianmarco De Gregori FreeBSD-DCO does not support TCP as transport protocol so in order to be able to use DCO in a multi-socket environment we need to check the local_list entries and disable DCO if any of the listening socket is TCP. While at it, removed some dead code left from Multisocket polishing. Github: closes OpenVPN/openvpn#710 Change-Id: I9b6359076a61ae2bbb8e5cea00e33969cb5f92cf Signed-off-by: Gianmarco De Gregori Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/925 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index d00958d..7ad9cb3 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -260,10 +260,16 @@ } #if defined(TARGET_FREEBSD) - if (!proto_is_udp(ce->proto)) + if (ce->local_list) { - msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD."); - return false; + for (int i = 0; i < ce->local_list->len; i++) + { + if (!proto_is_dgram(ce->local_list->array[i]->proto)) + { + msg(msglevel, "NOTE: TCP transport disables data channel offload on FreeBSD."); + return false; + } + } } #endif diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 99dd60a..6605a42 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -9577,20 +9577,3 @@ return false; } - -bool -has_tcp_in_local_list(const struct options *options) -{ - if (options->ce.local_list) - { - for (int i = 0; i < options->ce.local_list->len; i++) - { - if (!proto_is_dgram(options->ce.local_list->array[i]->proto)) - { - return true; - } - } - } - - return false; -} diff --git a/src/openvpn/options.h b/src/openvpn/options.h index fa617c8..8d1ef6c 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -921,8 +921,6 @@ bool has_udp_in_local_list(const struct options *options); -bool has_tcp_in_local_list(const struct options *options); - /** * Returns whether the current configuration has dco enabled. */