Skip to contentSkip to conversation

Define _GNU_SOURCE to get members of tcphdr&ucphdr

PATCH In review Felix Janda 1 participant 1 message May 16, 2015 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 5/6 Define _GNU_SOURCE to get members of tcphdr&ucphdr

The source uses linux names for members of tcphdr. For example "source" instead of "th_sport", ... musl libc's headers need _GNU_SOURCE defined in order to expose these.

---
 src/cthelper.c     | 1 +
 src/helpers/ftp.c  | 1 +
 src/helpers/sane.c | 1 +
 src/helpers/tns.c  | 1 +
 4 files changed, 4 insertions(+)
src/cthelper.c +1 -0
index fec40fb..bd8b8b7 100644
@@ -31,6 +31,7 @@
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
+#define _GNU_SOURCE
 #include <netinet/tcp.h>
 #include <netinet/udp.h>
 #include <net/ethernet.h>
src/helpers/ftp.c +1 -0
index e7fe7f7..24ee877 100644
@@ -25,6 +25,7 @@
 #include <ctype.h>	/* for isdigit */
 #include <errno.h>
 
+#define _GNU_SOURCE
 #include <netinet/tcp.h>
 
 #include <libmnl/libmnl.h>
src/helpers/sane.c +1 -0
index 79ca948..c30f4ba 100644
@@ -30,6 +30,7 @@
 #include "log.h"
 #include <errno.h>
 #include <netinet/ip.h>
+#define _GNU_SOURCE
 #include <netinet/tcp.h>
 #include <libmnl/libmnl.h>
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
src/helpers/tns.c +1 -0
index 5833fea..2b4fed4 100644
@@ -18,6 +18,7 @@
 #include <ctype.h>	/* for isdigit */
 #include <errno.h>
 
+#define _GNU_SOURCE
 #include <netinet/tcp.h>
 
 #include <libmnl/libmnl.h>
Signature · 1 line
2.3.6