From: Baruch Siach Date: Sat, 17 Nov 2018 20:20:08 +0000 (+0200) Subject: xtables-monitor: fix build with musl libc X-Git-Tag: v1.8.3~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90b0d3abfc0b4150b198eb17080d75acc5838a59;p=thirdparty%2Fiptables.git 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 Signed-off-by: Baruch Siach Signed-off-by: Florian Westphal --- 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 */ +#define _GNU_SOURCE #include #include #include