]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: tcp: define SOL_TCP when only IPPROTO_TCP exists
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Aug 2016 19:09:24 +0000 (21:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Aug 2016 19:11:38 +0000 (21:11 +0200)
FreeBSD prefers to use IPPROTO_TCP over SOL_TCP, just like it does
with their *_IP counterparts. It's worth noting that there are a few
inconsistencies between SOL_TCP and IPPROTO_TCP in the code, eg on
TCP_QUICKACK. The two values are the same but it's worth applying
what implementations recommend.

No backport is needed, this was uncovered by the recent tcp_info stuff.

include/common/compat.h

index b2e16af7f01fb2b577f47b47579fc55a58c75e1f..59bc6c7e9f6e2d7aa5872776e896ce4f1303a72d 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 
 #ifndef BITS_PER_INT
 #define BITS_PER_INT    (8*sizeof(int))
 #define SOL_IP IPPROTO_IP
 #endif
 
+/* same for SOL_TCP */
+#ifndef SOL_TCP
+#define SOL_TCP IPPROTO_TCP
+#endif
+
 /* If IPv6 is supported, define IN6_IS_ADDR_V4MAPPED() if missing. */
 #if defined(IPV6_TCLASS) && !defined(IN6_IS_ADDR_V4MAPPED)
 #define IN6_IS_ADDR_V4MAPPED(a) \