]> git.karo-electronics.de Git - linux-beck.git/commitdiff
netfilter: don't pull include/linux/netfilter.h from netns headers
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 17 Jun 2015 15:28:27 +0000 (10:28 -0500)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 18 Jun 2015 19:14:31 +0000 (21:14 +0200)
This pulls the full hook netfilter definitions from all those that include
net_namespace.h.

Instead let's just include the bare minimum required in the new
linux/netfilter_defs.h file, and use it from the netfilter netns header files.

I also needed to include in.h and in6.h from linux/netfilter.h otherwise we hit
this compilation error:

In file included from include/linux/netfilter_defs.h:4:0,
                 from include/net/netns/netfilter.h:4,
                 from include/net/net_namespace.h:22,
                 from include/linux/netdevice.h:43,
                 from net/netfilter/nfnetlink_queue_core.c:23:
include/uapi/linux/netfilter.h:76:17: error: field ‘in’ has incomplete type struct in_addr in;

And also explicit include linux/netfilter.h in several spots.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
include/linux/netfilter.h
include/linux/netfilter_defs.h [new file with mode: 0644]
include/net/netns/netfilter.h
include/net/netns/x_tables.h
include/uapi/linux/netfilter.h
net/ipv6/output_core.c

index f5ff5d156da8f5a6fe04eec19e9a41a7ac3f6ab0..00050dfd9f2309e9cd0f9a62f133e0d589fc47de 100644 (file)
@@ -10,7 +10,8 @@
 #include <linux/wait.h>
 #include <linux/list.h>
 #include <linux/static_key.h>
-#include <uapi/linux/netfilter.h>
+#include <linux/netfilter_defs.h>
+
 #ifdef CONFIG_NETFILTER
 static inline int NF_DROP_GETERR(int verdict)
 {
@@ -38,9 +39,6 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
 
 int netfilter_init(void);
 
-/* Largest hook number + 1 */
-#define NF_MAX_HOOKS 8
-
 struct sk_buff;
 
 struct nf_hook_ops;
diff --git a/include/linux/netfilter_defs.h b/include/linux/netfilter_defs.h
new file mode 100644 (file)
index 0000000..d3a7f85
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef __LINUX_NETFILTER_CORE_H_
+#define __LINUX_NETFILTER_CORE_H_
+
+#include <uapi/linux/netfilter.h>
+
+/* Largest hook number + 1, see uapi/linux/netfilter_decnet.h */
+#define NF_MAX_HOOKS 8
+
+#endif
index cf25b5e35f3c9d3d583a1a4028a527e0cbdf0f6f..532e4ba64f49a8ef8b8c52a9bd312acdf2011943 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __NETNS_NETFILTER_H
 #define __NETNS_NETFILTER_H
 
-#include <linux/netfilter.h>
+#include <linux/netfilter_defs.h>
 
 struct proc_dir_entry;
 struct nf_logger;
index 4d6597ad6067a838f0ab32ec5bb2ab2cbd0d070d..c8a7681efa6a5f33b1cb7afd92f48a7766c8ac82 100644 (file)
@@ -2,7 +2,7 @@
 #define __NETNS_X_TABLES_H
 
 #include <linux/list.h>
-#include <linux/netfilter.h>
+#include <linux/netfilter_defs.h>
 
 struct ebt_table;
 
index 177027cce6b347638d5ebdb887193ff7b825c9a6..d93f949d1d9aad326231829f70ba57b7b9cf10ee 100644 (file)
@@ -4,7 +4,8 @@
 #include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/sysctl.h>
-
+#include <linux/in.h>
+#include <linux/in6.h>
 
 /* Responses from hook functions. */
 #define NF_DROP 0
index 21678acd452165fae8a2c0b7c007ed1daa407344..928a0fb0b74406cdf32c89fe7db054b40476dc54 100644 (file)
@@ -8,6 +8,7 @@
 #include <net/ip6_fib.h>
 #include <net/addrconf.h>
 #include <net/secure_seq.h>
+#include <linux/netfilter.h>
 
 static u32 __ipv6_select_ident(struct net *net, u32 hashrnd,
                               const struct in6_addr *dst,