diff options
author | Patrick McHardy <kaber@trash.net> | 2007-09-28 17:41:27 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:36 -0400 |
commit | 7f85f914721ffcef382a57995182916bd43d8a65 (patch) | |
tree | 8f06ac1e3de0f48d3a5263a2578b674037c217b1 | |
parent | 2b5c841f2c41c023809e3b6b95a8320246cf7f5a (diff) |
[NETFILTER]: nf_conntrack: kill unique ID
Remove the per-conntrack ID, its not necessary anymore for dumping.
For compatiblity reasons we send the address of the conntrack to
userspace as ID.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 3 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 4 |
3 files changed, 2 insertions, 7 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 810020ec345d..90fb66d99d0c 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -116,9 +116,6 @@ struct nf_conn | |||
116 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | 116 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | /* Unique ID that identifies this conntrack*/ | ||
120 | unsigned int id; | ||
121 | |||
122 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 119 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
123 | u_int32_t mark; | 120 | u_int32_t mark; |
124 | #endif | 121 | #endif |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index f9d36cab70f4..83c30b45d170 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -63,7 +63,6 @@ unsigned int nf_ct_log_invalid __read_mostly; | |||
63 | HLIST_HEAD(unconfirmed); | 63 | HLIST_HEAD(unconfirmed); |
64 | static int nf_conntrack_vmalloc __read_mostly; | 64 | static int nf_conntrack_vmalloc __read_mostly; |
65 | static struct kmem_cache *nf_conntrack_cachep __read_mostly; | 65 | static struct kmem_cache *nf_conntrack_cachep __read_mostly; |
66 | static unsigned int nf_conntrack_next_id; | ||
67 | 66 | ||
68 | DEFINE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); | 67 | DEFINE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); |
69 | EXPORT_PER_CPU_SYMBOL(nf_conntrack_stat); | 68 | EXPORT_PER_CPU_SYMBOL(nf_conntrack_stat); |
@@ -287,7 +286,6 @@ static void __nf_conntrack_hash_insert(struct nf_conn *ct, | |||
287 | unsigned int hash, | 286 | unsigned int hash, |
288 | unsigned int repl_hash) | 287 | unsigned int repl_hash) |
289 | { | 288 | { |
290 | ct->id = ++nf_conntrack_next_id; | ||
291 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode, | 289 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode, |
292 | &nf_conntrack_hash[hash]); | 290 | &nf_conntrack_hash[hash]); |
293 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_REPLY].hnode, | 291 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_REPLY].hnode, |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index ce3581266b87..8406aee1cdee 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -257,7 +257,7 @@ nla_put_failure: | |||
257 | static inline int | 257 | static inline int |
258 | ctnetlink_dump_id(struct sk_buff *skb, const struct nf_conn *ct) | 258 | ctnetlink_dump_id(struct sk_buff *skb, const struct nf_conn *ct) |
259 | { | 259 | { |
260 | __be32 id = htonl(ct->id); | 260 | __be32 id = htonl((unsigned long)ct); |
261 | NLA_PUT(skb, CTA_ID, sizeof(u_int32_t), &id); | 261 | NLA_PUT(skb, CTA_ID, sizeof(u_int32_t), &id); |
262 | return 0; | 262 | return 0; |
263 | 263 | ||
@@ -723,7 +723,7 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
723 | 723 | ||
724 | if (cda[CTA_ID]) { | 724 | if (cda[CTA_ID]) { |
725 | u_int32_t id = ntohl(*(__be32 *)nla_data(cda[CTA_ID])); | 725 | u_int32_t id = ntohl(*(__be32 *)nla_data(cda[CTA_ID])); |
726 | if (ct->id != id) { | 726 | if (id != (u32)(unsigned long)ct) { |
727 | nf_ct_put(ct); | 727 | nf_ct_put(ct); |
728 | return -ENOENT; | 728 | return -ENOENT; |
729 | } | 729 | } |