]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed bug in port-share that could cause port share process to crash
authorJames Yonan <james@openvpn.net>
Sun, 3 Apr 2011 21:48:15 +0000 (23:48 +0200)
committerDavid Sommerseth <davids@redhat.com>
Thu, 14 Apr 2011 15:00:51 +0000 (17:00 +0200)
with output like this:

TCP connection established with 85.190.0.3:41781
85.190.0.3:41781 SIGTERM[soft,port-share-redirect] received, client-instance exiting
MANAGEMENT: TCP recv error: Socket operation on non-socket
MANAGEMENT: Client disconnected
MANAGEMENT: Triggering management exit
Exiting due to fatal error
EVENT: epoll_ctl EPOLL_CTL_MOD failed, sd=6: Bad file descriptor (errno=9)

Then an error like this for every incoming connection that should be
proxied:

76.120.71.74:55302 PORT SHARE: sendmsg failed -- unable to communicate with background process (6,8,-1,-1): Connection refused (errno=111)

Version 2.1.3s

ps.c

diff --git a/ps.c b/ps.c
index 9b9723cbc6108bbbbac33eb452298258443a4516..ef48e367e7991643321d0e1e5ce7aa7ff8c250cb 100644 (file)
--- a/ps.c
+++ b/ps.c
@@ -774,6 +774,9 @@ port_share_open (const char *host, const int port)
       /* Let msg know that we forked */
       msg_forked ();
 
+      /* Don't interact with management interface */
+      management = NULL;
+
       /* close all parent fds except our socket back to parent */
       close_fds_except (fd[1]);