TFO: use IPPROTO_TCP not SOL_TCL for setsockopt, being present on more platforms
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 25 Oct 2016 13:59:44 +0000 (14:59 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 25 Oct 2016 14:04:07 +0000 (15:04 +0100)
Also downgrade errors from panic-log to debug

src/src/daemon.c
src/src/ip.c

index dc49eeb85a32770ce98282c7c1539f844c5220cc..3ace7e9dbb5fc3efe8f5d76ce47b31db36069ee4 100644 (file)
@@ -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
index a8230a149d64e76cab2ee76e09597fd95281fc79..ee70cf469085294575624b1a87b5d1fac8e9e5f1 100644 (file)
@@ -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);
     }
   }