From: David Sommerseth Date: Thu, 25 Aug 2016 20:42:03 +0000 (+0200) Subject: Fix client connection instant timeout X-Git-Tag: v2.4_alpha1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4db062901fba790ac35cbf0cdd360306d8f2b81f;p=thirdparty%2Fopenvpn.git 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 Acked-by: Gert Doering Message-Id: 1472162097-17855-1-git-send-email-davids@openvpn.net URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg00125.html --- diff --git a/src/openvpn/init.c b/src/openvpn/init.c index ad4ebc33d..5b6d24684 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -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);