diff options
author | Patrick McHardy <kaber@trash.net> | 2009-06-22 08:17:12 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-06-22 08:17:12 -0400 |
commit | 4d900f9df5f0569c2dc536701e2c11b6d50ebebf (patch) | |
tree | e1ea624237ce9fab843080263ec51c5cadbe5c22 | |
parent | 6d62182fea6cc6bbc8d82a691ad0608d68a54aeb (diff) |
netfilter: xt_rateest: fix comparison with self
As noticed by Török Edwin <edwintorok@gmail.com>:
Compiling the kernel with clang has shown this warning:
net/netfilter/xt_rateest.c:69:16: warning: self-comparison always results in a
constant value
ret &= pps2 == pps2;
^
Looking at the code:
if (info->flags & XT_RATEEST_MATCH_BPS)
ret &= bps1 == bps2;
if (info->flags & XT_RATEEST_MATCH_PPS)
ret &= pps2 == pps2;
Judging from the MATCH_BPS case it seems to be a typo, with the intention of
comparing pps1 with pps2.
http://bugzilla.kernel.org/show_bug.cgi?id=13535
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | net/netfilter/xt_rateest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_rateest.c b/net/netfilter/xt_rateest.c index 220a1d588ee0..4fc6a917f6de 100644 --- a/net/netfilter/xt_rateest.c +++ b/net/netfilter/xt_rateest.c | |||
@@ -66,7 +66,7 @@ xt_rateest_mt(const struct sk_buff *skb, const struct xt_match_param *par) | |||
66 | if (info->flags & XT_RATEEST_MATCH_BPS) | 66 | if (info->flags & XT_RATEEST_MATCH_BPS) |
67 | ret &= bps1 == bps2; | 67 | ret &= bps1 == bps2; |
68 | if (info->flags & XT_RATEEST_MATCH_PPS) | 68 | if (info->flags & XT_RATEEST_MATCH_PPS) |
69 | ret &= pps2 == pps2; | 69 | ret &= pps1 == pps2; |
70 | break; | 70 | break; |
71 | } | 71 | } |
72 | 72 | ||