Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
BIND
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joey Salazar
BIND
Commits
a977bc4c
Commit
a977bc4c
authored
Aug 12, 2016
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4440. [func] Enable TCP fast open support when available on the
server side. [RT #42866]
parent
c7e021e2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
123 additions
and
0 deletions
+123
-0
CHANGES
CHANGES
+3
-0
configure
configure
+31
-0
configure.in
configure.in
+18
-0
doc/misc/tcp-fast-open
doc/misc/tcp-fast-open
+27
-0
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/platform.h.in
+5
-0
lib/isc/unix/socket.c
lib/isc/unix/socket.c
+22
-0
lib/isc/win32/include/isc/platform.h.in
lib/isc/win32/include/isc/platform.h.in
+3
-0
lib/isc/win32/socket.c
lib/isc/win32/socket.c
+14
-0
No files found.
CHANGES
View file @
a977bc4c
4440. [func] Enable TCP fast open support when available on the
server side. [RT #42866]
4439. [bug] Address race conditions getting ownernames of nodes.
[RT #43005]
...
...
configure
View file @
a977bc4c
...
...
@@ -761,6 +761,7 @@ ISC_LWRES_SETHOSTENTINT
ISC_LWRES_NEEDRRSETINFO
ISC_IRS_NEEDADDRINFO
ISC_LWRES_NEEDADDRINFO
ISC_PLATFORM_HAVETFO
ISC_PLATFORM_NEEDPORTT
ISC_PLATFORM_MSGHDRFLAVOR
LWRES_PLATFORM_HAVESALEN
...
...
@@ -18418,6 +18419,36 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# Look for TCP_FASTOPEN
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP_FASTOPEN socket option" >&5
$as_echo_n "checking for TCP_FASTOPEN socket option... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#ifdef TCP_FASTOPEN
int has_tfo() { return (0); }
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "has_tfo" >/dev/null 2>&1; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"
fi
rm -f conftest*
#
# Check for addrinfo
#
...
...
configure.in
View file @
a977bc4c
...
...
@@ -3107,6 +3107,24 @@ AC_TRY_COMPILE([
ISC_PLATFORM_NEEDPORTT="#define ISC_PLATFORM_NEEDPORTT 1"])
AC_SUBST(ISC_PLATFORM_NEEDPORTT)
#
# Look for TCP_FASTOPEN
#
AC_MSG_CHECKING(for TCP_FASTOPEN socket option)
AC_EGREP_CPP(has_tfo, [
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#ifdef TCP_FASTOPEN
int has_tfo() { return (0); }
#endif
],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVETFO="#define ISC_PLATFORM_HAVETFO 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVETFO="#undef ISC_PLATFORM_HAVETFO"])
AC_SUBST(ISC_PLATFORM_HAVETFO)
#
# Check for addrinfo
#
...
...
doc/misc/tcp-fast-open
0 → 100644
View file @
a977bc4c
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.
lib/isc/include/isc/platform.h.in
View file @
a977bc4c
...
...
@@ -125,6 +125,11 @@
*/
@ISC_PLATFORM_HAVESOCKADDRSTORAGE@
/*! \brief
* Define if the system has TCP_FASTOPEN socket option.
*/
@ISC_PLATFORM_HAVETFO@
/*! \brief
* Define if the system supports kqueue multiplexing
*/
...
...
lib/isc/unix/socket.c
View file @
a977bc4c
...
...
@@ -91,6 +91,10 @@
#include <sys/utsname.h>
#endif
#ifdef ISC_PLATFORM_HAVETFO
#include <netinet/tcp.h>
#endif
/*%
* Choose the most preferable multiplex method.
*/
...
...
@@ -5648,6 +5652,24 @@ isc__socket_listen(isc_socket_t *sock0, unsigned int backlog) {
return
(
ISC_R_UNEXPECTED
);
}
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN)
#ifdef __APPLE__
backlog
=
1
;
#else
backlog
=
backlog
/
2
;
if
(
backlog
==
0
)
backlog
=
1
;
#endif
if
(
setsockopt
(
sock
->
fd
,
IPPROTO_TCP
,
TCP_FASTOPEN
,
(
void
*
)
&
backlog
,
sizeof
(
backlog
))
<
0
)
{
isc__strerror
(
errno
,
strbuf
,
sizeof
(
strbuf
));
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"setsockopt(%d, TCP_FASTOPEN) failed with %s"
,
sock
->
fd
,
strbuf
);
/* TCP_FASTOPEN is experimental so ignore failures */
}
#endif
sock
->
listener
=
1
;
UNLOCK
(
&
sock
->
lock
);
...
...
lib/isc/win32/include/isc/platform.h.in
View file @
a977bc4c
...
...
@@ -31,6 +31,9 @@
#define ISC_PLATFORM_NEEDNTOP
#define ISC_PLATFORM_NEEDPTON
#define ISC_PLATFORM_HAVESOCKADDRSTORAGE
#ifdef _MSC_VER >= 1900
#define ISC_PLATFORM_HAVETFO
#endif
#define ISC_PLATFORM_QUADFORMAT "I64"
...
...
lib/isc/win32/socket.c
View file @
a977bc4c
...
...
@@ -3319,6 +3319,9 @@ isc__socket_filter(isc_socket_t *sock, const char *filter) {
isc_result_t
isc__socket_listen
(
isc_socket_t
*
sock
,
unsigned
int
backlog
)
{
char
strbuf
[
ISC_STRERRORSIZE
];
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN)
char
on
=
1
;
#endif
REQUIRE
(
VALID_SOCKET
(
sock
));
...
...
@@ -3349,6 +3352,17 @@ isc__socket_listen(isc_socket_t *sock, unsigned int backlog) {
return
(
ISC_R_UNEXPECTED
);
}
#if defined(ISC_PLATFORM_HAVETFO) && defined(TCP_FASTOPEN)
if
(
setsockopt
(
sock
->
fd
,
IPPROTO_TCP
,
TCP_FASTOPEN
,
&
on
,
sizeof
(
on
))
<
0
)
{
isc__strerror
(
errno
,
strbuf
,
sizeof
(
strbuf
));
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
"setsockopt(%d, TCP_FASTOPEN) failed with %s"
,
sock
->
fd
,
strbuf
);
/* TCP_FASTOPEN is experimental so ignore failures */
}
#endif
socket_log
(
__LINE__
,
sock
,
NULL
,
TRACE
,
isc_msgcat
,
ISC_MSGSET_SOCKET
,
ISC_MSG_BOUND
,
"listening"
);
sock
->
listener
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment