From: Willy Tarreau Date: Wed, 6 Oct 2021 18:06:06 +0000 (+0200) Subject: BUILD: compat: fix -Wundef on SO_REUSEADDR X-Git-Tag: v2.5-dev9~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a2134138aa2cf0e6d7d4cf146b810861254639b;p=thirdparty%2Fhaproxy.git BUILD: compat: fix -Wundef on SO_REUSEADDR If USE_NETFILTER is set and not SO_REUSEPORT, we evaluate SO_REUSEADDR, let's fix that to check that it's defined. --- diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index 19a5317860..18eadcc565 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -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 */