aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2014-12-08 08:49:55 +0000
committerRaphael Kubo da Costa <rakuco@FreeBSD.org>2014-12-08 08:49:55 +0000
commit67b76c5a1de914d19b21c8ac4803c6a7c56692d7 (patch)
treecb84934730aa9bbbc936960ba92dce88c16349d7
parent76391abd31481dbec95b20de04f99277bb03c84b (diff)
downloadports-67b76c5a1de914d19b21c8ac4803c6a7c56692d7.tar.gz
ports-67b76c5a1de914d19b21c8ac4803c6a7c56692d7.zip
MFH: r374162
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). Approved by: ports-secteam (delphij)
Notes
Notes: svn path=/branches/2014Q4/; revision=374238
-rw-r--r--net/krdc/files/patch-vnc__vncclientthread.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/net/krdc/files/patch-vnc__vncclientthread.cpp b/net/krdc/files/patch-vnc__vncclientthread.cpp
new file mode 100644
index 000000000000..55f3adfe12b8
--- /dev/null
+++ b/net/krdc/files/patch-vnc__vncclientthread.cpp
@@ -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";
+ }