]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: compat: fix -Wundef on SO_REUSEADDR
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 18:06:06 +0000 (20:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 23:36:51 +0000 (01:36 +0200)
If USE_NETFILTER is set and not SO_REUSEPORT, we evaluate SO_REUSEADDR,
let's fix that to check that it's defined.

include/haproxy/compat.h

index 19a5317860efd349788415abc5bf62ac0ab7be97..18eadcc565d88f2517b7c57941e2ef4aabaeca4e 100644 (file)
@@ -207,9 +207,9 @@ typedef struct { } empty_t;
  * USE_NETFILTER define.
  */
 #if !defined(SO_REUSEPORT) && defined(USE_NETFILTER)
-#if    (SO_REUSEADDR == 2)
+#if defined(SO_REUSEADDR) && (SO_REUSEADDR == 2)
 #define SO_REUSEPORT 15
-#elif  (SO_REUSEADDR == 0x0004)
+#elif defined(SO_REUSEADDR) && (SO_REUSEADDR == 0x0004)
 #define SO_REUSEPORT 0x0200
 #endif /* SO_REUSEADDR */
 #endif /* SO_REUSEPORT */