diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-08 05:35:03 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 05:35:03 -0400 |
commit | 400dad39d1c33fe797e47326d87a3f54d0ac5181 (patch) | |
tree | f3bb7c9f75bd24161c2dd745f1b475f5a6165cae /include/net | |
parent | 49ac8713b6d064adf7474080fdccebd7cce76be0 (diff) |
netfilter: netns nf_conntrack: per-netns conntrack hash
* make per-netns conntrack hash
Other solution is to add ->ct_net pointer to tuplehashes and still has one
hash, I tried that it's ugly and requires more code deep down in protocol
modules et al.
* propagate netns pointer to where needed, e. g. to conntrack iterators.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 6 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_core.h | 3 | ||||
-rw-r--r-- | include/net/netns/conntrack.h | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 5999c5313d0b..f5447f143047 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -195,11 +195,11 @@ extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, | |||
195 | unsigned int size); | 195 | unsigned int size); |
196 | 196 | ||
197 | extern struct nf_conntrack_tuple_hash * | 197 | extern struct nf_conntrack_tuple_hash * |
198 | __nf_conntrack_find(const struct nf_conntrack_tuple *tuple); | 198 | __nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple); |
199 | 199 | ||
200 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); | 200 | extern void nf_conntrack_hash_insert(struct nf_conn *ct); |
201 | 201 | ||
202 | extern void nf_conntrack_flush(void); | 202 | extern void nf_conntrack_flush(struct net *net); |
203 | 203 | ||
204 | extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, | 204 | extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, |
205 | unsigned int nhoff, u_int16_t l3num, | 205 | unsigned int nhoff, u_int16_t l3num, |
@@ -261,7 +261,7 @@ extern struct nf_conn nf_conntrack_untracked; | |||
261 | 261 | ||
262 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ | 262 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ |
263 | extern void | 263 | extern void |
264 | nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data), void *data); | 264 | nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); |
265 | extern void nf_conntrack_free(struct nf_conn *ct); | 265 | extern void nf_conntrack_free(struct nf_conn *ct); |
266 | extern struct nf_conn * | 266 | extern struct nf_conn * |
267 | nf_conntrack_alloc(struct net *net, | 267 | nf_conntrack_alloc(struct net *net, |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 532aa200cbc9..1c373564396a 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
@@ -48,7 +48,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, | |||
48 | 48 | ||
49 | /* Find a connection corresponding to a tuple. */ | 49 | /* Find a connection corresponding to a tuple. */ |
50 | extern struct nf_conntrack_tuple_hash * | 50 | extern struct nf_conntrack_tuple_hash * |
51 | nf_conntrack_find_get(const struct nf_conntrack_tuple *tuple); | 51 | nf_conntrack_find_get(struct net *net, const struct nf_conntrack_tuple *tuple); |
52 | 52 | ||
53 | extern int __nf_conntrack_confirm(struct sk_buff *skb); | 53 | extern int __nf_conntrack_confirm(struct sk_buff *skb); |
54 | 54 | ||
@@ -71,7 +71,6 @@ print_tuple(struct seq_file *s, const struct nf_conntrack_tuple *tuple, | |||
71 | const struct nf_conntrack_l3proto *l3proto, | 71 | const struct nf_conntrack_l3proto *l3proto, |
72 | const struct nf_conntrack_l4proto *proto); | 72 | const struct nf_conntrack_l4proto *proto); |
73 | 73 | ||
74 | extern struct hlist_head *nf_conntrack_hash; | ||
75 | extern spinlock_t nf_conntrack_lock ; | 74 | extern spinlock_t nf_conntrack_lock ; |
76 | extern struct hlist_head unconfirmed; | 75 | extern struct hlist_head unconfirmed; |
77 | 76 | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index edf84714d7c7..b767683f112b 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -5,5 +5,7 @@ | |||
5 | 5 | ||
6 | struct netns_ct { | 6 | struct netns_ct { |
7 | atomic_t count; | 7 | atomic_t count; |
8 | struct hlist_head *hash; | ||
9 | int hash_vmalloc; | ||
8 | }; | 10 | }; |
9 | #endif | 11 | #endif |