From patchwork Mon Jul 28 08:42:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4332 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:3644:b0:671:5a2c:6455 with SMTP id a4csp2905422mai; Mon, 28 Jul 2025 01:43:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUSEUub9Qkjnb2vOFGTaLpGUKC2AQjQT1MVpK+grMvwQTlEB2486/FNLAbgRJzI7O4GfvgER99LTc=@openvpn.net X-Google-Smtp-Source: AGHT+IHu5fP8guf0jq/VAj1GkZUhB3NpkJl0N3Lwa1WMTjq7xtPhUF5Y4W1tzuSO/HbrNhZJVxVC X-Received: by 2002:a05:6870:3311:b0:2ef:17b3:3c9d with SMTP id 586e51a60fabf-30701cc5a19mr6048835fac.7.1753692188197; Mon, 28 Jul 2025 01:43:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1753692188; cv=none; d=google.com; s=arc-20240605; b=hzCa2w4lxruxjr8tBaHE0sCVQoZigurUI88DUcDhibObyx9U42qzQNv5NZ8/NetR9I hfPeMuoNUyoH4czb7QHJFUKn98ckj7y8h6FySbk9mStcxVoFyLnlJq8KvU24v4t2LGyU DtoGGUVZQKM2YAU7CZy1e3lZFKm8i0UyymQnqUPL3vTs4Fh12TIR4E6MdPYm7/TTCyXY jENfKgBcdr8x/j4C52FFyFROPdUILatcY78UHmPzd7ZEWeaqUUQFkXAEgCCFcHrmB4YH WaCJTlh87ZppkQ/ifNlueq3L+ryAKftiZW4nZxI/zI7rr4J3SuHJbpILqdGQ35DZKNeh 5gJA== 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:dkim-signature; bh=VZfDPibVMD6mr+CZXe66lS7rRCmamEM7Y9jFzWIvUVc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=PKzPl0Bt2ji+4qeLDXVsSke5YFGacB0fknU13PiMLNqZV5hNFQ3r3jgCtNIctOmcRO hZi6H4OY+IbM5WqIQWfshOa/DiUiZt0WMrgw0N+Hjnp1N/VA2uckwFDzspAv+bjqCZ9v 4hliBbuyaP5MZjbYuC4ypbvUZSHof8XPLs3W9lyiCwEYQ/QoCGu3HsK6lKphzBdl8m7N sZJc4uiDCHsdJNKI0sEMn5cw7iBz++hLZ3kwM1gbWj/IvdNWOb2icjyuAxATpIr93hAI slRrvSFzm5hyFbaKaGTIgR8ncI2LoApk9KX1bZYz2r3vvGNDrjhRnojzusDeciF8UvWH BZXQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=BOFbwOqd; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XVY6A3Vh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=faWrAFRY; 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 46e09a7af769-741480d1533si1988215a34.82.2025.07.28.01.43.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jul 2025 01:43:07 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=BOFbwOqd; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XVY6A3Vh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=faWrAFRY; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VZfDPibVMD6mr+CZXe66lS7rRCmamEM7Y9jFzWIvUVc=; b=BOFbwOqdvyi6Kmh3vMymPO7r1o I7kodhs/3zgP1K858Ng6hQRWbXftmHjtX/rv+kjcpiptuGdZPY2UlK4FhouwW3VSNA30HC0FDZ8sC rE6235vot0JwYDuLhHcgv7QDsI4th1r8HeFtyjvcmccs+BvMumPbkX/R4+XmNtOmCOk4=; 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 1ugJRo-00021m-Ot; Mon, 28 Jul 2025 08:43:05 +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 1ugJRn-00021Y-EH for openvpn-devel@lists.sourceforge.net; Mon, 28 Jul 2025 08:43: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: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=n119PRWzVDAQNCvcfBoURRA+dJBHWdZD0v08z1nb0tI=; b=XVY6A3VhY78bplTXmFHRtz12jV FyfzVjG2QkyFXhWuEHthZ8AKT0vFRjAYnoO4n2Or/8S2w1p5jOwwxqv/PizAWiMFcrAppBNW6eMnA rTZ7dTJxR9kG9B5kYDNW4e/acXdKfdPgo9ibelPRoR9wHkmGhOVRIAk78UFGMwmZfh0g=; 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=n119PRWzVDAQNCvcfBoURRA+dJBHWdZD0v08z1nb0tI=; b=faWrAFRY6m2u4V1/IhI03ixsZE 0zwiROKNiLT3BPUkxaFbrrfS41bxv3SXTPvWjx+lKeoAWblOO2FOF969j0rw683B5QhzqFu6MbNBi VBi+nuRw9WLFo6i+OJhAq6RclP1JQnjEIYkjSxJwvqg/RArr90h7xQmJGh2MqRy+GXPA=; Received: from [193.149.48.143] (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 1ugJRm-0000hE-M5 for openvpn-devel@lists.sourceforge.net; Mon, 28 Jul 2025 08:43:04 +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 56S8gtg0001858 for ; Mon, 28 Jul 2025 10:42:55 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 56S8gtFT001857 for openvpn-devel@lists.sourceforge.net; Mon, 28 Jul 2025 10:42:55 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 28 Jul 2025 10:42:49 +0200 Message-ID: <20250728084255.1824-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", 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: With commit b66b80b2a all three platforms with DCO support have DCO float notifications now, so the #ifdef inside multi_process_incoming_dco() is no longer needed. Also, the whole notification block (process_incoming_del_peer() and multi_process_incoming_dco()) was surrounded by an Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1ugJRm-0000hE-M5 Subject: [Openvpn-devel] [PATCH v3] mudp.c, multi.c, multi_io.c: get rid of "all three DCO platforms" #ifdefs 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?1838879540337896583?= X-GMAIL-MSGID: =?utf-8?q?1838879540337896583?= With commit b66b80b2a all three platforms with DCO support have DCO float notifications now, so the #ifdef inside multi_process_incoming_dco() is no longer needed. Also, the whole notification block (process_incoming_del_peer() and multi_process_incoming_dco()) was surrounded by an #ifdef ENABLE_DCO "and all 3 platforms" which is also not making sense anymore (if we add a fourth DCO platform, we need to aim for having "all notifications from day 1", at least having the stubs and defines). Last not least, the event stuff in mudp.c and multi_io.c had grown the same construct - and we'll need events for any future DCO platform, too. So, fix those #ifdef as well, while at it. Change-Id: I6977d23b5289eba5db436608e0500216e0e689ec Signed-off-by: Gert Doering Acked-by: Antonio Quartulli --- 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/+/1117 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Antonio Quartulli diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index ee8446a..118c954 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -412,8 +412,7 @@ multi_process_file_closed(m, mpp_flags); } #endif -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32)) +#if defined(ENABLE_DCO) else if (status & DCO_READ) { if (!IS_SIG(&m->top)) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 49f5320..b2d2b6c 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3337,8 +3337,7 @@ } #endif -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32)) +#if defined(ENABLE_DCO) static void process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi, dco_context_t *dco) @@ -3409,7 +3408,6 @@ { process_incoming_del_peer(m, mi, dco); } -#if defined(TARGET_LINUX) || defined(TARGET_WIN32) || defined(TARGET_FREEBSD) else if (dco->dco_message_type == OVPN_CMD_FLOAT_PEER) { ASSERT(mi->context.c2.link_sockets[0]); @@ -3419,7 +3417,6 @@ multi_process_float(m, mi, mi->context.c2.link_sockets[0]); CLEAR(dco->dco_float_peer_ss); } -#endif /* if defined(TARGET_LINUX) || defined(TARGET_WIN32) */ else if (dco->dco_message_type == OVPN_CMD_SWAP_KEYS) { tls_session_soft_reset(mi->context.c2.tls_multi); @@ -3452,7 +3449,7 @@ dco->dco_write_bytes = 0; return ret > 0; } -#endif /* if defined(ENABLE_DCO) && defined(TARGET_LINUX) */ +#endif /* if defined(ENABLE_DCO) */ /* * Process packets in the TCP/UDP socket -> TUN/TAP interface direction, diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c index 4854f4b..102ee2f 100644 --- a/src/openvpn/multi_io.c +++ b/src/openvpn/multi_io.c @@ -191,8 +191,7 @@ } tun_set(m->top.c1.tuntap, m->multi_io->es, EVENT_READ, MULTI_IO_TUN, persistent); -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32)) +#if defined(ENABLE_DCO) dco_event_set(&m->top.c1.tuntap->dco, m->multi_io->es, MULTI_IO_DCO); #endif @@ -526,8 +525,7 @@ multi_io_action(m, mi, TA_INITIAL, false); } } -#if defined(ENABLE_DCO) \ - && (defined(TARGET_LINUX) || defined(TARGET_FREEBSD) || defined(TARGET_WIN32)) +#if defined(ENABLE_DCO) /* incoming data on DCO? */ else if (e->arg == MULTI_IO_DCO) {