4440. [func] Enable TCP fast open support when available on the

server side. [RT #42866]

(cherry picked from commit a977bc4c8e)
This commit is contained in:
Mark Andrews
2016-08-12 15:32:00 +10:00
parent b4bbf49418
commit c5342425ea
8 changed files with 123 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Some systems (Linux, FreeBSD, OS X/macOS and Windows 10) support
the TCP Fast Open (RFC 7413) mechanism in their recent versions.
BIND 9 supports this on the server side.
When the TCP_FASTOPEN socket option is defined after the listen()
system call the socket code in the libisc set the option with
the half of the listen backlog (so the fast open maximum queue length
is the half of the pending connection queue length).
Any failure is logged and ignored.
System specific notes:
- FreeBSD doesn't interpret the argument as a queue length but
only as an on/off switch.
- Apple OS X/macOS allows only 0 or 1 so the code puts 1 for this system.
- Windows 10 uses a 0/1 char flag and perhaps as not yet server support?
- the only other system known to support this is Linux.