Commit 7f85f914721ffcef382a57995182916bd43d8a65
Committed by
David S. Miller
1 parent
2b5c841f2c
Exists in
master
and in
7 other branches
[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>
Showing 3 changed files with 2 additions and 7 deletions Side-by-side Diff
include/net/netfilter/nf_conntrack.h
net/netfilter/nf_conntrack_core.c
... | ... | @@ -63,7 +63,6 @@ |
63 | 63 | HLIST_HEAD(unconfirmed); |
64 | 64 | static int nf_conntrack_vmalloc __read_mostly; |
65 | 65 | static struct kmem_cache *nf_conntrack_cachep __read_mostly; |
66 | -static unsigned int nf_conntrack_next_id; | |
67 | 66 | |
68 | 67 | DEFINE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat); |
69 | 68 | EXPORT_PER_CPU_SYMBOL(nf_conntrack_stat); |
... | ... | @@ -287,7 +286,6 @@ |
287 | 286 | unsigned int hash, |
288 | 287 | unsigned int repl_hash) |
289 | 288 | { |
290 | - ct->id = ++nf_conntrack_next_id; | |
291 | 289 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode, |
292 | 290 | &nf_conntrack_hash[hash]); |
293 | 291 | hlist_add_head(&ct->tuplehash[IP_CT_DIR_REPLY].hnode, |
net/netfilter/nf_conntrack_netlink.c
... | ... | @@ -257,7 +257,7 @@ |
257 | 257 | static inline int |
258 | 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 | 261 | NLA_PUT(skb, CTA_ID, sizeof(u_int32_t), &id); |
262 | 262 | return 0; |
263 | 263 | |
... | ... | @@ -723,7 +723,7 @@ |
723 | 723 | |
724 | 724 | if (cda[CTA_ID]) { |
725 | 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 | 727 | nf_ct_put(ct); |
728 | 728 | return -ENOENT; |
729 | 729 | } |