From 4670e9d3b06f6f14c5d868f786b75e2d6b921c8d Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 25 Oct 2016 14:59:44 +0100 Subject: [PATCH] TFO: use IPPROTO_TCP not SOL_TCL for setsockopt, being present on more platforms Also downgrade errors from panic-log to debug --- src/src/daemon.c | 7 +++---- src/src/ip.c | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/src/daemon.c b/src/src/daemon.c index dc49eeb85..3ace7e9db 100644 --- a/src/src/daemon.c +++ b/src/src/daemon.c @@ -1458,10 +1458,9 @@ if (daemon_listen && !inetd_wait_mode) debug_printf("listening on %s port %d\n", ipa->address, ipa->port); #ifdef TCP_FASTOPEN - if (setsockopt(listen_sockets[sk], SOL_TCP, TCP_FASTOPEN, &smtp_connect_backlog, - sizeof(smtp_connect_backlog))) - log_write(0, LOG_MAIN|LOG_PANIC, "failed to set socket FASTOPEN: %s", - strerror(errno)); + if (setsockopt(listen_sockets[sk], IPPROTO_TCP, TCP_FASTOPEN, + &smtp_connect_backlog, sizeof(smtp_connect_backlog))) + DEBUG(D_any) debug_printf("setsockopt FASTOPEN: %s", strerror(errno)); #endif /* Start listening on the bound socket, establishing the maximum backlog of diff --git a/src/src/ip.c b/src/src/ip.c index a8230a149..ee70cf469 100644 --- a/src/src/ip.c +++ b/src/src/ip.c @@ -239,8 +239,8 @@ if (fastopen) && errno == EOPNOTSUPP ) { - log_write(0, LOG_MAIN|LOG_PANIC, - "Tried TCP Fast Open but apparently not enabled by sysctl"); + DEBUG(D_transport) + debug_printf("Tried TCP Fast Open but apparently not enabled by sysctl"); rc = connect(sock, s_ptr, s_len); } } -- 2.25.1