diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-10-14 14:58:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-14 14:58:31 -0400 |
commit | e6a7d3c04f8fe49099521e6dc9a46b0272381f2f (patch) | |
tree | 4717fcfe05549d39c9281b3b23310b775ad38d16 /include | |
parent | 129404a1f117c35c6224e020444fc27eb4479817 (diff) |
netfilter: ctnetlink: remove bogus module dependency between ctnetlink and nf_nat
This patch removes the module dependency between ctnetlink and
nf_nat by means of an indirect call that is initialized when
nf_nat is loaded. Now, nf_conntrack_netlink only requires
nf_conntrack and nfnetlink.
This patch puts nfnetlink_parse_nat_setup_hook into the
nf_conntrack_core to avoid dependencies between ctnetlink,
nf_conntrack_ipv4 and nf_conntrack_ipv6.
This patch also introduces the function ctnetlink_change_nat
that is only invoked from the creation path. Actually, the
nat handling cannot be invoked from the update path since
this is not allowed. By introducing this function, we remove
the useless nat handling in the update path and we avoid
deadlock-prone code.
This patch also adds the required EAGAIN logic for nfnetlink.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/nfnetlink.h | 3 | ||||
-rw-r--r-- | include/net/netfilter/nf_nat_core.h | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 0d8424f76899..7d8e0455ccac 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -78,6 +78,9 @@ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | |||
78 | int echo); | 78 | int echo); |
79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 79 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
80 | 80 | ||
81 | extern void nfnl_lock(void); | ||
82 | extern void nfnl_unlock(void); | ||
83 | |||
81 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | 84 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ |
82 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | 85 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) |
83 | 86 | ||
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h index f29eeb9777e0..58684066388c 100644 --- a/include/net/netfilter/nf_nat_core.h +++ b/include/net/netfilter/nf_nat_core.h | |||
@@ -25,4 +25,12 @@ static inline int nf_nat_initialized(struct nf_conn *ct, | |||
25 | else | 25 | else |
26 | return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status); | 26 | return test_bit(IPS_DST_NAT_DONE_BIT, &ct->status); |
27 | } | 27 | } |
28 | |||
29 | struct nlattr; | ||
30 | |||
31 | extern int | ||
32 | (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, | ||
33 | enum nf_nat_manip_type manip, | ||
34 | struct nlattr *attr); | ||
35 | |||
28 | #endif /* _NF_NAT_CORE_H */ | 36 | #endif /* _NF_NAT_CORE_H */ |