]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix client connection instant timeout
authorDavid Sommerseth <davids@openvpn.net>
Thu, 25 Aug 2016 20:42:03 +0000 (22:42 +0200)
committerDavid Sommerseth <davids@openvpn.net>
Fri, 26 Aug 2016 15:12:03 +0000 (17:12 +0200)
Commit b3e975824ea9ebae8dbea5b451c8d02525c83ffe moved the finalizing of
TCP/UDP sockets before the UID/GID where dropped.  But this did not
factor that the timeout code had been revamped [1] in the mean time.

This ensures the timout initialization is done before the the socket
finalizing has been completed.

[1] commit f2134b7bea37df15756c599b94f16d4bffafbbd6

Signed-off-by: David Sommerseth <davids@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: 1472162097-17855-1-git-send-email-davids@openvpn.net
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg00125.html

src/openvpn/init.c

index ad4ebc33d6de6c3d6ae546b4bfe0fa2bcc476a0c..5b6d2468436ad156e727a9a43fa7fd309855a4c9 100644 (file)
@@ -3696,6 +3696,9 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
     open_plugins (c, false, OPENVPN_PLUGIN_INIT_POST_DAEMON);
 #endif
 
+  /* initialise connect timeout timer */
+  do_init_server_poll_timeout(c);
+
   /* finalize the TCP/UDP socket */
   if (c->mode == CM_P2P || c->mode == CM_TOP || c->mode == CM_CHILD_TCP)
     do_init_socket_2 (c);
@@ -3706,9 +3709,6 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
    */
   do_uid_gid_chroot (c, c->c2.did_open_tun);
 
-  /* initialise connect timeout timer */
-  do_init_server_poll_timeout(c);
-
   /* initialize timers */
   if (c->mode == CM_P2P || child)
     do_init_timers (c, false);