]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/io: extend logging for TCP Fast Open failure
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 4 Mar 2020 12:47:02 +0000 (13:47 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 6 Mar 2020 08:01:57 +0000 (09:01 +0100)
In FreeBSD it's disabled by default, causing this error.
I tried disabling it on Linux via sysctl, but that didn't seem
to cause any errors.

daemon/io.c

index eb1f276ab3cf87bcf45e63508ee7442edbefc9e0..fb1a1d076169ab13cb299d56ce84d651284c1ba6 100644 (file)
@@ -440,7 +440,9 @@ int io_listen_tcp(uv_loop_t *loop, uv_tcp_t *handle, int fd, int tcp_backlog, bo
        val = 1; /* Accepts on/off */
        #endif
        if (setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, &val, sizeof(val))) {
-               kr_log_error("[ io ] listen TCP (fastopen): %s\n", strerror(errno));
+               kr_log_error("[ io ] listen TCP (fastopen): %s%s\n", strerror(errno),
+                       (errno != EPERM ? "" :
+                        ".  This may be caused by TCP Fast Open being disabled in the OS."));
        }
 #endif