From 590faf89a2dd33a5f97f8e685efd019ac9c96e1e Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 23 Oct 2018 22:23:56 +0100 Subject: [PATCH] MacOS: probe for a usable TFO system configuration --- src/OS/os.h-Darwin | 6 ++++++ src/src/daemon.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/OS/os.h-Darwin b/src/OS/os.h-Darwin index b597f9da3..d0a1a092f 100644 --- a/src/OS/os.h-Darwin +++ b/src/OS/os.h-Darwin @@ -53,4 +53,10 @@ in "man 2 getgroups". */ #define _DARWIN_UNLIMITED_GETGROUPS #define EXIM_GROUPLIST_SIZE 64 +/* TCP_FASTOPEN support. For the moment, claim there is none +(the probe fails; unsure why). +Sometime in the future need to investigate connectex(). */ + +#define EXIM_TFO_PROBE + /* End */ diff --git a/src/src/daemon.c b/src/src/daemon.c index d69a7db3d..ee9ddcc4f 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1459,7 +1459,8 @@ if (f.daemon_listen && !f.inetd_wait_mode) debug_printf("listening on %s port %d\n", ipa->address, ipa->port); #ifdef TCP_FASTOPEN - if (setsockopt(listen_sockets[sk], IPPROTO_TCP, TCP_FASTOPEN, + if ( f.tcp_fastopen_ok + && setsockopt(listen_sockets[sk], IPPROTO_TCP, TCP_FASTOPEN, &smtp_connect_backlog, sizeof(smtp_connect_backlog))) { DEBUG(D_any) debug_printf("setsockopt FASTOPEN: %s\n", strerror(errno)); -- 2.25.1