Browse code

Fix client connection instant timeout

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

David Sommerseth authored on 2016/08/26 05:42:03
Showing 1 changed files
... ...
@@ -3696,6 +3696,9 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
3696 3696
     open_plugins (c, false, OPENVPN_PLUGIN_INIT_POST_DAEMON);
3697 3697
 #endif
3698 3698
 
3699
+  /* initialise connect timeout timer */
3700
+  do_init_server_poll_timeout(c);
3701
+
3699 3702
   /* finalize the TCP/UDP socket */
3700 3703
   if (c->mode == CM_P2P || c->mode == CM_TOP || c->mode == CM_CHILD_TCP)
3701 3704
     do_init_socket_2 (c);
... ...
@@ -3706,9 +3709,6 @@ init_instance (struct context *c, const struct env_set *env, const unsigned int
3706 3706
    */
3707 3707
   do_uid_gid_chroot (c, c->c2.did_open_tun);
3708 3708
 
3709
-  /* initialise connect timeout timer */
3710
-  do_init_server_poll_timeout(c);
3711
-
3712 3709
   /* initialize timers */
3713 3710
   if (c->mode == CM_P2P || child)
3714 3711
     do_init_timers (c, false);