]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp: socket translate TCP_KEEPIDLE for macOs equivalent
authorDavid CARLIER <devnexen@gmail.com>
Sun, 1 May 2022 14:29:58 +0000 (15:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 May 2022 08:35:39 +0000 (10:35 +0200)
On Linux the interval before starting to send TCP keep-alive packets
is defined by TCP_KEEPIDLE. MacOS has an equivalent with TCP_KEEPIDLE,
which also uses seconds as a unit, so it's possible to simply remap the
definition of TCP_KEEPIDLE to TCP_KEEPALIVE there and get it to seamlessly
work. The other settings (interval and count) are not present, though.

include/haproxy/compat.h

index da037fd7f9c77034250e3855888057ff56ca0714..b2ef8d0b2b7c3559ee2c4d6766000edb63a876fe 100644 (file)
@@ -284,6 +284,7 @@ typedef struct { } empty_t;
 #include <malloc/malloc.h>
 #define malloc_usable_size malloc_size
 #define HA_HAVE_MALLOC_ZONE
+#define TCP_KEEPIDLE TCP_KEEPALIVE
 #define TCP_INFO TCP_CONNECTION_INFO
 #define tcp_info tcp_connection_info
 #endif