From 721d8ef88a3ca7e453c7ac32c709cfa02e884072 Mon Sep 17 00:00:00 2001 From: "Gabriel L. Somlo" Date: Mon, 21 Mar 2016 17:42:46 -0400 Subject: [PATCH] patch to fix RHBZ 1319858, 1319859 --- vtun-client-sighup.patch | 33 +++++++++++++++++++++++++++++++++ vtun.spec | 22 ++++++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 vtun-client-sighup.patch 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 102d8c3..cbda083 100644 --- a/vtun.spec +++ b/vtun.spec @@ -1,6 +1,6 @@ Name: vtun Version: 3.0.3 -Release: 11%{?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,10 +33,14 @@ require modification to any kernel parts. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %{__autoconf} -%configure +# FIXME: Package suffers from c11/inline issues. +# Workaround by appending --std=gnu89 to CFLAGS +# Proper fix would be to fix the source-code +%configure CFLAGS="${RPM_OPT_FLAGS} --std=gnu89" make %{?_smp_mflags} %install @@ -68,6 +73,19 @@ 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 + +* Mon Jun 22 2015 Ralf Corsépius - 3.0.3-13 +- Append --stdc=gnu89 to CFLAGS (Work-around to c11/inline compatibility + issues. Fix FTBFS). + +* Fri Jun 19 2015 Fedora Release Engineering - 3.0.3-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Tue Dec 23 2014 Gabriel Somlo 3.0.3-11 - enhanced service file (remove "KillMode", use default "cgroup" mode)