From: "cron2 (Code Review)" Date: Wed, 28 Jan 2026 13:28:24 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <807ab047c56d4658a5f8104ebfa5a5a3f1944373-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="9an6fBQAjTc="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: tunnel_server(): close correct inotify fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: plaisthos , openvpn-devel --9an6fBQAjTc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/14= 97?usp=3Demail ) Change subject: tunnel_server(): close correct inotify fd ...................................................................... tunnel_server(): close correct inotify fd On a full SIGUSR1 restart of a p2mp server compiled with --enable-async-push, tunnel_server() will try to close and reopen the "inotify" control file descriptor. For whatever reason, the original code referenced the wrong context, always closing fd 0. As a consequence of this, on the second SIGUSR1 restart, the server will close() the first active socket file descriptor, and if there are active DCO clients, the resulting event confusion will lead to an ASSERT(!mi->halt). Fix by closing the correct FD. Add logging. Github: fixes OpenVPN/openvpn#966 Change-Id: Iabc117848ad7b67d240c392f1a6aa2d7531fd5bb Signed-off-by: Gert Doering Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1497 Message-Id: <20260128110425.24350-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 478.html Signed-off-by: Gert Doering --- M src/openvpn/multi.c 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 2af49d2..d983793 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -4244,7 +4244,9 @@ tunnel_server_loop(&multi); #ifdef ENABLE_ASYNC_PUSH - close(top->c2.inotify_fd); + msg(D_LOW, "%s: close multi.top.c2.inotify_fd (%d)", + __func__, multi.top.c2.inotify_fd); + close(multi.top.c2.inotify_fd); #endif /* shut down management interface */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1497?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Iabc117848ad7b67d240c392f1a6aa2d7531fd5bb Gerrit-Change-Number: 1497 Gerrit-PatchSet: 2 Gerrit-Owner: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --9an6fBQAjTc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

tunnel_server(): close correct inotify fd
On a full SIGUSR1 restart of a p2mp server compiled with
--enable-async= -push, tunnel_server() will try to close and reopen
the "inotify&qu= ot; control file descriptor. For whatever reason, the
original code ref= erenced the wrong context, always closing fd 0.

As a consequence of = this, on the second SIGUSR1 restart, the server
will close() the first a= ctive socket file descriptor, and if there
are active DCO clients, the r= esulting event confusion will lead to
an ASSERT(!mi->halt).

Fi= x by closing the correct FD. Add logging.

Github: fixes OpenVPN/open= vpn#966

Change-Id: Iabc117848ad7b67d240c392f1a6aa2d7531fd5bb
Sign= ed-off-by: Gert Doering <gert@...1296...>
Acked-by: Arne Schwabe &= lt;arne-openvpn@...1227...>
Gerrit URL: https://gerrit.openvpn.net/c/= openvpn/+/1497
Message-Id: <20260128110425.24350-1-gert@...1296...>= ;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/= msg35478.html
Signed-off-by: Gert Doering <gert@...1296...>
---=
M src/openvpn/multi.c
1 file changed, 3 insertions(+), 1 deletion(-)=

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
i= ndex 2af49d2..d983793 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -4244,7 +4244,9 @@=
tunnel_server_loop(&multi);

#ifdef ENABLE_ASYNC_PUSH
- close(top->c2.inotify_fd);
+ msg(D_LOW, "%s: close multi.top.c2.= inotify_fd (%d)",
+ close(multi.top.c2.inotify_fd);
#endif

/* shut down management = interface */

To view, visit change 1497. To= unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iabc117848ad7b67d240c392f1a6= aa2d7531fd5bb
Gerrit-Change-Number: 1497
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --9an6fBQAjTc=--