diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2009-02-24 09:30:29 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-02-24 09:30:29 -0500 |
commit | 28337ff5438a640afa713d874d076e3a8a9150da (patch) | |
tree | 4a5f0558d780f938802e55e729f29da7987e4ca5 | |
parent | d060ffc1840e37100628f520e66600c5ae483b44 (diff) |
netfilter: xt_hashlimit fix
Commit 784544739a25c30637397ace5489eeb6e15d7d49
(netfilter: iptables: lock free counters) broke xt_hashlimit netfilter module :
This module was storing a pointer inside its xt_hashlimit_info, and this pointer
is not relocated when we temporarly switch tables (iptables -L).
This hack is not not needed at all (probably a leftover from
ancient time), as each cpu should and can access to its own copy.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 2482055e1c5..a5b5369c30f 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -565,8 +565,7 @@ hashlimit_init_dst(const struct xt_hashlimit_htable *hinfo, | |||
565 | static bool | 565 | static bool |
566 | hashlimit_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par) | 566 | hashlimit_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par) |
567 | { | 567 | { |
568 | const struct xt_hashlimit_info *r = | 568 | const struct xt_hashlimit_info *r = par->matchinfo; |
569 | ((const struct xt_hashlimit_info *)par->matchinfo)->u.master; | ||
570 | struct xt_hashlimit_htable *hinfo = r->hinfo; | 569 | struct xt_hashlimit_htable *hinfo = r->hinfo; |
571 | unsigned long now = jiffies; | 570 | unsigned long now = jiffies; |
572 | struct dsthash_ent *dh; | 571 | struct dsthash_ent *dh; |
@@ -702,8 +701,6 @@ static bool hashlimit_mt_check_v0(const struct xt_mtchk_param *par) | |||
702 | } | 701 | } |
703 | mutex_unlock(&hlimit_mutex); | 702 | mutex_unlock(&hlimit_mutex); |
704 | 703 | ||
705 | /* Ugly hack: For SMP, we only want to use one set */ | ||
706 | r->u.master = r; | ||
707 | return true; | 704 | return true; |
708 | } | 705 | } |
709 | 706 | ||