[PATCH xtables] xtables-monitor: fix build with older glibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



glibc older than 2.19 require _BSD_SOURCE to expose BSD style fields of
struct tcphdr. 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 'th_sport'
    printf("SPORT=%d DPORT=%d ", ntohs(tcph->th_sport), ntohs(tcph->th_dport));
                                           ^
xtables-monitor.c:406:66: error: 'const struct tcphdr' has no member named 'th_dport'
    printf("SPORT=%d DPORT=%d ", ntohs(tcph->th_sport), ntohs(tcph->th_dport));
                                                                  ^
...

Cc: Florian Westphal <fw@xxxxxxxxx>
Signed-off-by: Baruch Siach <baruch@xxxxxxxxxx>
---
 iptables/xtables-monitor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/iptables/xtables-monitor.c b/iptables/xtables-monitor.c
index 3b1ca777a28a..f664dc541ab3 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 _BSD_SOURCE
 #include <stdlib.h>
 #include <time.h>
 #include <string.h>
-- 
2.19.1




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux