summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2018-11-17 22:20:08 +0200
committerFlorian Westphal <fw@strlen.de>2018-11-17 21:24:17 +0100
commit90b0d3abfc0b4150b198eb17080d75acc5838a59 (patch)
treec81e9a68bc6a9a2b1af7288c24ae87f97270d832
parent8d9d7e4b9ef4c6e6abab2cf35c747d7ca36824bd (diff)
xtables-monitor: fix build with musl libc
Commit 7c8791edac3 ("xtables-monitor: fix build with older glibc") changed the code to use GNU style tcphdr fields. Unfortunately, musl libc requires _GNU_SOURCE definition to expose these fields. Fix the following build failure: xtables-monitor.c: In function ‘trace_print_packet’: xtables-monitor.c:406:43: error: ‘const struct tcphdr’ has no member named ‘source’ printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest)); ^~ xtables-monitor.c:406:64: error: ‘const struct tcphdr’ has no member named ‘dest’ printf("SPORT=%d DPORT=%d ", ntohs(tcph->source), ntohs(tcph->dest)); ^~ ... Cc: Florian Westphal <fw@strlen.de> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--iptables/xtables-monitor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
index 5d161112..f835c5e5 100644
--- a/iptables/xtables-monitor.c
+++ b/iptables/xtables-monitor.c
@@ -9,6 +9,7 @@
* This software has been sponsored by Sophos Astaro <http://www.sophos.com>
*/
+#define _GNU_SOURCE
#include <stdlib.h>
#include <time.h>
#include <string.h>