提交 a263653e 编写于 作者: P Pablo Neira Ayuso

netfilter: don't pull include/linux/netfilter.h from netns headers

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: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 10c04a8e
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/static_key.h> #include <linux/static_key.h>
#include <uapi/linux/netfilter.h> #include <linux/netfilter_defs.h>
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
static inline int NF_DROP_GETERR(int verdict) 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, ...@@ -38,9 +39,6 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
int netfilter_init(void); int netfilter_init(void);
/* Largest hook number + 1 */
#define NF_MAX_HOOKS 8
struct sk_buff; struct sk_buff;
struct nf_hook_ops; struct nf_hook_ops;
......
#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
#ifndef __NETNS_NETFILTER_H #ifndef __NETNS_NETFILTER_H
#define __NETNS_NETFILTER_H #define __NETNS_NETFILTER_H
#include <linux/netfilter.h> #include <linux/netfilter_defs.h>
struct proc_dir_entry; struct proc_dir_entry;
struct nf_logger; struct nf_logger;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __NETNS_X_TABLES_H #define __NETNS_X_TABLES_H
#include <linux/list.h> #include <linux/list.h>
#include <linux/netfilter.h> #include <linux/netfilter_defs.h>
struct ebt_table; struct ebt_table;
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/in.h>
#include <linux/in6.h>
/* Responses from hook functions. */ /* Responses from hook functions. */
#define NF_DROP 0 #define NF_DROP 0
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <net/ip6_fib.h> #include <net/ip6_fib.h>
#include <net/addrconf.h> #include <net/addrconf.h>
#include <net/secure_seq.h> #include <net/secure_seq.h>
#include <linux/netfilter.h>
static u32 __ipv6_select_ident(struct net *net, u32 hashrnd, static u32 __ipv6_select_ident(struct net *net, u32 hashrnd,
const struct in6_addr *dst, const struct in6_addr *dst,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册