From: Remi Gacogne Date: Fri, 17 Mar 2017 14:42:38 +0000 (+0100) Subject: rec: Add server-side TCP Fast Open support X-Git-Tag: rec-4.1.0-alpha1~196^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0735b17ec9a70b1433c65456b7b6fb24222d394a;p=pdns rec: Add server-side TCP Fast Open support --- diff --git a/docs/markdown/recursor/settings.md b/docs/markdown/recursor/settings.md index cb71da62a..c79cfbc93 100644 --- a/docs/markdown/recursor/settings.md +++ b/docs/markdown/recursor/settings.md @@ -866,6 +866,14 @@ Size of the stack per thread. Number of entries in the remotes ringbuffer, which keeps statistics on who is querying your server. Can be read out using `rec_control top-remotes`. +## `tcp-fast-open` +* Integer +* Default: 0 (Disabled) +* Available since: 4.1 + +Enable TCP Fast Open support, if available, on the listening sockets. The numerical +value supplied is used as the queue size, 0 meaning disabled. + ## `threads` * Integer * Default: 2 diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d038455b5..bb4db079b 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1844,6 +1844,17 @@ static void makeTCPServerSockets() } #endif + if (::arg().asNum("tcp-fast-open") > 0) { +#ifdef TCP_FASTOPEN + int fastOpenQueueSize = ::arg().asNum("tcp-fast-open"); + if (setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &fastOpenQueueSize, sizeof fastOpenQueueSize) < 0) { + L<