diff --git a/vtun-client-sighup.patch b/vtun-client-sighup.patch new file mode 100644 index 0000000..c67bc91 --- /dev/null +++ b/vtun-client-sighup.patch @@ -0,0 +1,33 @@ +When sending a SIGHUP to a vtun client process which is unable to connect +to the remote server, it will attempt to reconnect without sleeping between +consecutive attempts. This results in a CPU usage spike, and a flood of +data sent to syslog. +This patch causes the first sleep after SIGHUP to be discarded, then allows +sleep to be used again in subsequent iterations. +diff -NarU5 a/client.c b/client.c +--- a/client.c 2012-07-08 01:32:57.000000000 -0400 ++++ b/client.c 2016-03-21 17:17:34.111775616 -0400 +@@ -131,10 +131,11 @@ + + if( connect_t(s,(struct sockaddr *) &svr_addr, host->timeout) ){ + if (!vtun.quiet || errno != ETIMEDOUT) + vtun_syslog(LOG_INFO,"Connect to %s failed. %s(%d)", vtun.svr_name, + strerror(errno), errno); ++ client_term = 0; + } else { + if( auth_client(s, host) ){ + vtun_syslog(LOG_INFO,"Session %s[%s] opened",host->host,vtun.svr_name); + + host->rmt_fd = s; +@@ -143,10 +144,11 @@ + client_term = tunnel(host); + + vtun_syslog(LOG_INFO,"Session %s[%s] closed",host->host,vtun.svr_name); + } else { + vtun_syslog(LOG_INFO,"Connection denied by %s",vtun.svr_name); ++ client_term = 0; + } + } + close(s); + free_sopt(&host->sopt); + } diff --git a/vtun.spec b/vtun.spec index 4af910a..cbda083 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,6 +1,6 @@ Name: vtun Version: 3.0.3 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Virtual tunnel over TCP/IP networks License: GPLv2+ Group: System Environment/Daemons @@ -10,6 +10,7 @@ Source1: vtun.socket Source2: vtun.service Source3: vtun.sysconfig Patch0: vtun-nostrip.patch +Patch1: vtun-client-sighup.patch Requires(post): systemd-units Requires(preun): systemd-units @@ -32,6 +33,7 @@ require modification to any kernel parts. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %{__autoconf} @@ -71,6 +73,9 @@ make install DESTDIR=%{buildroot} INSTALL_OWNER= INSTALL="/usr/bin/install -p" %{_mandir}/man8/vtund.8* %changelog +* Mon Mar 21 2016 Gabriel Somlo 3.0.3-15 +- patch to fix #1319858,#1319859,#1319861 + * Fri Feb 05 2016 Fedora Release Engineering - 3.0.3-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild