ea2e60
diff --git a/compat/os/linux.h b/compat/os/linux.h
ea2e60
index 0ff05c6..d51389b 100644
ea2e60
--- a/compat/os/linux.h
ea2e60
+++ b/compat/os/linux.h
ea2e60
@@ -44,6 +44,36 @@
ea2e60
 #include <netinet/in.h>
c00279
 #endif
c00279
 
ea2e60
+/*
c00279
+ * Netfilter header madness. (see Bug 4323)
c00279
+ *
c00279
+ * Netfilter have a history of defining their own versions of network protocol
c00279
+ * primitives without sufficient protection against the POSIX defines which are
c00279
+ * aways present in Linux.
c00279
+ *
c00279
+ * netinet/in.h must be included before any other sys header in order to properly
c00279
+ * activate include guards in <linux/libc-compat.h> the kernel maintainers added
c00279
+ * to workaround it.
c00279
+ */
c00279
+#if HAVE_NETINET_IN_H
c00279
+#include <netinet/in.h>
c00279
+#endif
c00279
+
c00279
+/*
c00279
+ * Netfilter header madness. (see Bug 4323)
c00279
+ *
c00279
+ * Netfilter have a history of defining their own versions of network protocol
c00279
+ * primitives without sufficient protection against the POSIX defines which are
c00279
+ * aways present in Linux.
c00279
+ *
c00279
+ * netinet/in.h must be included before any other sys header in order to properly
c00279
+ * activate include guards in <linux/libc-compat.h> the kernel maintainers added
c00279
+ * to workaround it.
c00279
+ */
c00279
+#if HAVE_NETINET_IN_H
c00279
+#include <netinet/in.h>
c00279
+#endif
c00279
+
ea2e60
 /*
c00279
  * sys/capability.h is only needed in Linux apparently.
c00279
  *