From owner-svn-ports-all@FreeBSD.ORG Sat Dec 6 23:03:58 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84A564B0; Sat, 6 Dec 2014 23:03:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5708AD5D; Sat, 6 Dec 2014 23:03:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6N3wer095854; Sat, 6 Dec 2014 23:03:58 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6N3wGP095853; Sat, 6 Dec 2014 23:03:58 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201412062303.sB6N3wGP095853@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Sat, 6 Dec 2014 23:03:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r374162 - head/net/krdc/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 23:03:58 -0000 Author: rakuco Date: Sat Dec 6 23:03:57 2014 New Revision: 374162 URL: https://svnweb.freebsd.org/changeset/ports/374162 QAT: https://qat.redports.org/buildarchive/r374162/ Log: Add local patch to fix the build on FreeBSD 8. FreeBSD 8 does not have support for the TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT options (the values are always hardcoded). We can fix it by only calling setsockopt(2) with those options if they are defined. At least for now, I have decided not to upstream this change because it basically affects only FreeBSD 8 these days (the other BSDs, Linux and OS X have had support for those options for many years). MFH: 2014Q4 Added: head/net/krdc/files/ head/net/krdc/files/patch-vnc__vncclientthread.cpp (contents, props changed) Added: head/net/krdc/files/patch-vnc__vncclientthread.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/krdc/files/patch-vnc__vncclientthread.cpp Sat Dec 6 23:03:57 2014 (r374162) @@ -0,0 +1,40 @@ +Only use TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT if they exist. + +These options are present only in FreeBSD 9+, so we need this patch to maintain +compatibility with FreeBSD 8. + +Not worth upstreaming, as OS X, Linux, NetBSD, OpenBSD and DragonFlyBSD have +had these options for much longer than us. +--- vnc/vncclientthread.cpp ++++ vnc/vncclientthread.cpp +@@ -606,23 +606,30 @@ void VncClientThread::clientSetKeepalive() + return; + } + ++#ifdef TCP_KEEPIDLE + optval = m_keepalive.intervalSeconds; + if (setsockopt(cl->sock, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) { + kError(5011) << "setsockopt(TCP_KEEPIDLE)" << strerror(errno); + return; + } ++#endif + ++#ifdef TCP_KEEPINTVL + optval = m_keepalive.intervalSeconds; + if (setsockopt(cl->sock, IPPROTO_TCP, TCP_KEEPINTVL, &optval, optlen) < 0) { + kError(5011) << "setsockopt(TCP_KEEPINTVL)" << strerror(errno); + return; + } ++#endif + ++#ifdef TCP_KEEPCNT + optval = m_keepalive.failedProbes; + if(setsockopt(cl->sock, IPPROTO_TCP, TCP_KEEPCNT, &optval, optlen) < 0) { + kError(5011) << "setsockopt(TCP_KEEPCNT)" << strerror(errno); + return; + } ++#endif ++ + m_keepalive.set = true; + kDebug(5011) << "TCP keepalive set"; + }