netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iptables] utils: nfsynproxy: fix build with musl libc
@ 2017-03-02  7:35 Baruch Siach
  2017-03-03  9:55 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Baruch Siach @ 2017-03-02  7:35 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik
  Cc: netfilter-devel, coreteam, Baruch Siach

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>
---
 utils/nfsynproxy.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/nfsynproxy.c b/utils/nfsynproxy.c
index baedc92c5d9f..bf5c416340f1 100644
--- a/utils/nfsynproxy.c
+++ b/utils/nfsynproxy.c
@@ -6,6 +6,7 @@
  * published by the Free Software Foundation.
  */
 
+#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdbool.h>
 #include <unistd.h>
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-03 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02  7:35 [PATCH iptables] utils: nfsynproxy: fix build with musl libc Baruch Siach
2017-03-03  9:55 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).