]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
utils: nfsynproxy: fix build with musl libc
authorBaruch Siach <baruch@tkos.co.il>
Thu, 2 Mar 2017 07:35:07 +0000 (09:35 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Mar 2017 09:55:13 +0000 (10:55 +0100)
The musl libc exposes some struct tcphdr field only when _GNU_SOURCE is
defined. Fix the following build failure:

nfsynproxy.c: In function ‘parse_packet’:
nfsynproxy.c:34:9: error: ‘const struct tcphdr’ has no member named ‘syn’
  if (!th->syn || !th->ack)
         ^
nfsynproxy.c:34:21: error: ‘const struct tcphdr’ has no member named ‘ack’
  if (!th->syn || !th->ack)
                     ^
nfsynproxy.c:42:8: error: ‘const struct tcphdr’ has no member named ‘res2’
  if (th->res2 == 0x1)
        ^
nfsynproxy.c:45:13: error: ‘const struct tcphdr’ has no member named ‘doff’
  length = th->doff * 4 - sizeof(*th);
             ^

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
utils/nfsynproxy.c

index baedc92c5d9fbb199b2d638b082e217afd9b0cf8..bf5c416340f14ccad1c64e824136697bad4b2c59 100644 (file)
@@ -6,6 +6,7 @@
  * published by the Free Software Foundation.
  */
 
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdbool.h>
 #include <unistd.h>