diff options
author | Patrick McHardy <kaber@trash.net> | 2007-09-28 17:41:50 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:36 -0400 |
commit | 3583240249ef354760e04ae49bd7b462a638f40c (patch) | |
tree | 2969e4b10f237dcabce0c03648f27ed825140c32 | |
parent | 7f85f914721ffcef382a57995182916bd43d8a65 (diff) |
[NETFILTER]: nf_conntrack_expect: kill unique ID
Similar to the conntrack ID, the per-expectation ID is not needed
anymore, kill it.
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_expect.h | 3 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_expect.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 6 |
3 files changed, 3 insertions, 8 deletions
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index cae1a0dce365..b47c04f12dbe 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -38,9 +38,6 @@ struct nf_conntrack_expect | |||
38 | /* Usage count. */ | 38 | /* Usage count. */ |
39 | atomic_t use; | 39 | atomic_t use; |
40 | 40 | ||
41 | /* Unique ID */ | ||
42 | unsigned int id; | ||
43 | |||
44 | /* Flags */ | 41 | /* Flags */ |
45 | unsigned int flags; | 42 | unsigned int flags; |
46 | 43 | ||
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index 8a3e3af656bf..7a0ae36c9b47 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -41,7 +41,6 @@ static int nf_ct_expect_hash_rnd_initted __read_mostly; | |||
41 | static int nf_ct_expect_vmalloc; | 41 | static int nf_ct_expect_vmalloc; |
42 | 42 | ||
43 | static struct kmem_cache *nf_ct_expect_cachep __read_mostly; | 43 | static struct kmem_cache *nf_ct_expect_cachep __read_mostly; |
44 | static unsigned int nf_ct_expect_next_id; | ||
45 | 44 | ||
46 | /* nf_conntrack_expect helper functions */ | 45 | /* nf_conntrack_expect helper functions */ |
47 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) | 46 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) |
@@ -302,7 +301,6 @@ static void nf_ct_expect_insert(struct nf_conntrack_expect *exp) | |||
302 | exp->timeout.expires = jiffies + master_help->helper->timeout * HZ; | 301 | exp->timeout.expires = jiffies + master_help->helper->timeout * HZ; |
303 | add_timer(&exp->timeout); | 302 | add_timer(&exp->timeout); |
304 | 303 | ||
305 | exp->id = ++nf_ct_expect_next_id; | ||
306 | atomic_inc(&exp->use); | 304 | atomic_inc(&exp->use); |
307 | NF_CT_STAT_INC(expect_create); | 305 | NF_CT_STAT_INC(expect_create); |
308 | } | 306 | } |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 8406aee1cdee..2abd648f7d6f 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1160,7 +1160,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, | |||
1160 | { | 1160 | { |
1161 | struct nf_conn *master = exp->master; | 1161 | struct nf_conn *master = exp->master; |
1162 | __be32 timeout = htonl((exp->timeout.expires - jiffies) / HZ); | 1162 | __be32 timeout = htonl((exp->timeout.expires - jiffies) / HZ); |
1163 | __be32 id = htonl(exp->id); | 1163 | __be32 id = htonl((unsigned long)exp); |
1164 | 1164 | ||
1165 | if (ctnetlink_exp_dump_tuple(skb, &exp->tuple, CTA_EXPECT_TUPLE) < 0) | 1165 | if (ctnetlink_exp_dump_tuple(skb, &exp->tuple, CTA_EXPECT_TUPLE) < 0) |
1166 | goto nla_put_failure; | 1166 | goto nla_put_failure; |
@@ -1346,7 +1346,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1346 | 1346 | ||
1347 | if (cda[CTA_EXPECT_ID]) { | 1347 | if (cda[CTA_EXPECT_ID]) { |
1348 | __be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]); | 1348 | __be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]); |
1349 | if (exp->id != ntohl(id)) { | 1349 | if (ntohl(id) != (u32)(unsigned long)exp) { |
1350 | nf_ct_expect_put(exp); | 1350 | nf_ct_expect_put(exp); |
1351 | return -ENOENT; | 1351 | return -ENOENT; |
1352 | } | 1352 | } |
@@ -1400,7 +1400,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1400 | 1400 | ||
1401 | if (cda[CTA_EXPECT_ID]) { | 1401 | if (cda[CTA_EXPECT_ID]) { |
1402 | __be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]); | 1402 | __be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]); |
1403 | if (exp->id != ntohl(id)) { | 1403 | if (ntohl(id) != (u32)(unsigned long)exp) { |
1404 | nf_ct_expect_put(exp); | 1404 | nf_ct_expect_put(exp); |
1405 | return -ENOENT; | 1405 | return -ENOENT; |
1406 | } | 1406 | } |