From patchwork Sat Nov 14 16:51:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5696 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:3119:b0:11a:a05e:cb97 with SMTP id e25csp884348laa; Sat, 14 Nov 2026 08:52:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHiukks1nBoNZxPFMu71rPpMiCbxD4pnEhwP93NxT+Qje0ETb8qfgylJ4fh6gcGE59kba/b6UHP/Ws=@openvpn.net X-Received: by 2002:a05:701b:2810:b0:1b2:4e2e:d95a with SMTP id a92af1059eb24-1b503068e0cmr5328348c88.2.1794675126676; Sat, 14 Nov 2026 08:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794675126; cv=none; d=google.com; s=arc-20260327; b=X5O6JcqmMJDga/x+BFdyW5olnCl+ydsFc8flnzErJYVAfNwUoVSFtZDQX/ZRQjWN8t jFxj1hjh0vp+LKjFnDIkAtYTgOMUR+9uTTxjtFFAaTD2f8qxD5ANTtnxaaVEjY4gYHqk AMVQ3u/rQWhKWNSYjju1cWnXqKKmzrE1PoTAAbHmLK/dy3bzYnfO2oVzPcUbMK8Fj3t4 gmgY7Q15Ts+wAjyVScXJANwGgJ8/Bnlmpdag2RHxrnFj5txGJbdGKkhEUPtuycE23+o+ /1wRVYUC90ez9FAVnloTtGi5g95xQiAxCVQ1G8fLgVqUuF8aYd5KY/S8/I5ZMEs20xvf 0V6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=DGryAC98/gYF/35Tzziei3LT/BMUG3yg5l/lznGUTrI=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=h1Vh1h68QjUNVQbd1Nr4980/Ok2A2s//gBgmC59OZxR32kwNVYkpL9F2VSyzJiSalq 645gMwl9vdKuSe6nD6/1yvppMSwCLngEcLb+SYgLjZECc+paM35uhEwBpzidHglqtFvV J/0qB0vPqpz5fnIieUjO+XfKaE1XrF1e3arhVjLoAn9iRolWli+GC64jJ6noVtQyrNcp 9XKsHNIctOfK5KjCw7u0WjY6Z+YrM1LSvmrg7AtnjrjFFDhw0schzMMBFWioaHvOs6WG SK7cEVrNJjBgd8DO6xYX9lpEbjm2oU5tRWy9SwOZ+JDF6EZhxV/2k3vrqmaT8GZwKMN1 axGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="S92bj/b0"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=lMPArPiT; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QCPlaFIA; 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 a92af1059eb24-1b503219f7dsi15701349c88.54.2026.11.14.08.52.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Nov 2026 08:52:06 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b="S92bj/b0"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=lMPArPiT; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=QCPlaFIA; 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-Unsubscribe-Post: List-Owner; bh=DGryAC98/gYF/35Tzziei3LT/BMUG3yg5l/lznGUTrI=; b=S92bj/b0fD0zUL KmiQZUhfjqz+iHIsnMmEk7WH22MI0QKqyrT8O6TsnX7GSNrZgxwNsftRo/dVY0wMo1IMcjARtnzcg C+XEifv6bYtN4i/e7u3G1jLh1hAbCixRm/WMnxp8B6AZ0AeC7YR3n2PjNr/9gjh8HWMyVWTRJTMSg gf8=; 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.100.1) (envelope-from ) id 1xSGyz-000000007Mb-2L5r; Sat, 14 Nov 2026 16:52:05 +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.100.1) (envelope-from ) id 1xSGyy-000000007MU-22C7 for openvpn-devel@lists.sourceforge.net; Sat, 14 Nov 2026 16:52: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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sfKKUZ7sa1G9yLhPlwtIyOSvz6GgYgEpBZQflARF2qo=; b=lMPArPiThpa/AayOVlpYTSssDG CYmBQlELS8dc/SzgGpADs3p5Tr6T7+XkOufDSKzD/UPeokTv6lRQzQaJ8nCujyj/JCuar1uVH5s8s fol0fEYuAn+vXb0bSxlyUbMIxIZfiBLDuW8ZFtQmdvBlxvcw5XjdRTwI73CGtVnDCuTc=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sfKKUZ7sa1G9yLhPlwtIyOSvz6GgYgEpBZQflARF2qo=; b=QCPlaFIAwK6zNvyWDZrdmlcsG2 /UiYAP9yJ3lh7UWKPI01vEYhT2TyKCnXWPGGni1V2sN/75dbWjlHe/WrBlMGLnjwmiQhr6hnzAJ5i YXgrDjMW3vR4gIp7Pr//xtv971JzTIoxKwHFVOmfmZ0aTQj4Me3CK5iBDbttRwtRTwNY=; Received: from [193.149.48.129] (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.100.1) id 1xSGyx-000000001Oo-2ed8 for openvpn-devel@lists.sourceforge.net; Sat, 14 Nov 2026 16:52:04 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6AEGpvL5007755 for ; Sat, 14 Nov 2026 17:51:57 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6AEGpvpV007754 for openvpn-devel@lists.sourceforge.net; Sat, 14 Nov 2026 17:51:57 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sat, 14 Nov 2026 17:51:51 +0100 Message-ID: <20261114165156.7743-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.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-2.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: From: Gianmarco De Gregori multi_process_file_closed() is the last place where multi_process_post() runs without a multi_io_action() following it, so any output it produces stays in m->pending across event_wait(). 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: 1xSGyx-000000001Oo-2ed8 Subject: [Openvpn-devel] [PATCH v3] multi: resume deferred auth through multi_io_action() 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: 1881853265213260911 X-GMAIL-MSGID: 1881853265213260911 From: Gianmarco De Gregori multi_process_file_closed() is the last place where multi_process_post() runs without a multi_io_action() following it, so any output it produces stays in m->pending across event_wait(). Add TA_INSTANCE_POST, which only runs multi_process_post() on the given instance, and use it so pending output is flushed as for every other event. Likewise, an instance signalled during this post-processing is now closed right away instead of on its next event. This is needed before m->pending can be removed. Change-Id: I49777902951d3a05c48cddd0d33c14e028e5d706 Signed-off-by: Gianmarco De Gregori Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2047 --- 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/+/2047 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 3f82052..b1a648b 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2841,7 +2841,7 @@ * (or be deferred again by client-connect) */ void -multi_process_file_closed(struct multi_context *m, const unsigned int mpp_flags) +multi_process_file_closed(struct multi_context *m) { char buffer[INOTIFY_EVENT_BUFFER_SIZE]; ssize_t buffer_i = 0; @@ -2869,7 +2869,7 @@ if (mi) { /* continue authentication, perform NCP negotiation and send push_reply */ - multi_process_post(m, mi, mpp_flags); + multi_io_action(m, mi, TA_INSTANCE_POST, false); } else { diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h index 3d2e932..4a93971 100644 --- a/src/openvpn/multi.h +++ b/src/openvpn/multi.h @@ -382,9 +382,8 @@ * Continues authentication and sends push_repl * * @param m multi_context - * @param mpp_flags */ -void multi_process_file_closed(struct multi_context *m, const unsigned int mpp_flags); +void multi_process_file_closed(struct multi_context *m); #endif diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c index fb4810b..a6e97af 100644 --- a/src/openvpn/multi_io.c +++ b/src/openvpn/multi_io.c @@ -85,6 +85,9 @@ case TA_TUN_WRITE_TIMEOUT: return "TA_TUN_WRITE_TIMEOUT"; + case TA_INSTANCE_POST: + return "TA_INSTANCE_POST"; + default: return "?"; } @@ -492,6 +495,11 @@ multi_process_post(m, mi, mpp_flags); break; + case TA_INSTANCE_POST: + ASSERT(mi); + multi_process_post(m, mi, mpp_flags); + break; + default: msg(M_FATAL, "MULTI IO: multi_io_dispatch, unhandled action=%d", action); } @@ -659,7 +667,7 @@ #ifdef ENABLE_ASYNC_PUSH else if (e->arg == MULTI_IO_FILE_CLOSE_WRITE) { - multi_process_file_closed(m, MPP_PRE_SELECT | MPP_RECORD_TOUCH); + multi_process_file_closed(m); } #endif } diff --git a/src/openvpn/multi_io.h b/src/openvpn/multi_io.h index c7f8f89..4d56e25 100644 --- a/src/openvpn/multi_io.h +++ b/src/openvpn/multi_io.h @@ -44,6 +44,7 @@ #define TA_INITIAL 8 #define TA_TIMEOUT 9 #define TA_TUN_WRITE_TIMEOUT 10 +#define TA_INSTANCE_POST 11 /* * I/O state and events tracker