diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2012-06-29 05:42:28 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-07-09 04:53:04 -0400 |
commit | a73f89a61f92b364f0b4a3be412b5b70553afc23 (patch) | |
tree | 9a6d725e53f4066bfa216192e83199b5051f3285 /net | |
parent | 9e85a6f9dc231f3ed3c1dc1b12217505d970142a (diff) |
netfilter: ipset: timeout fixing bug broke SET target special timeout value
The patch "127f559 netfilter: ipset: fix timeout value overflow bug"
broke the SET target when no timeout was specified.
Reported-by: Jean-Philippe Menil <jean-philippe.menil@univ-nantes.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_set.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c index 035960ec5cb9..c6f7db720d84 100644 --- a/net/netfilter/xt_set.c +++ b/net/netfilter/xt_set.c | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/netfilter/x_tables.h> | 17 | #include <linux/netfilter/x_tables.h> |
18 | #include <linux/netfilter/xt_set.h> | 18 | #include <linux/netfilter/xt_set.h> |
19 | #include <linux/netfilter/ipset/ip_set_timeout.h> | ||
19 | 20 | ||
20 | MODULE_LICENSE("GPL"); | 21 | MODULE_LICENSE("GPL"); |
21 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); | 22 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); |
@@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const struct xt_action_param *par) | |||
310 | info->del_set.flags, 0, UINT_MAX); | 311 | info->del_set.flags, 0, UINT_MAX); |
311 | 312 | ||
312 | /* Normalize to fit into jiffies */ | 313 | /* Normalize to fit into jiffies */ |
313 | if (add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | 314 | if (add_opt.timeout != IPSET_NO_TIMEOUT && |
315 | add_opt.timeout > UINT_MAX/MSEC_PER_SEC) | ||
314 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; | 316 | add_opt.timeout = UINT_MAX/MSEC_PER_SEC; |
315 | if (info->add_set.index != IPSET_INVALID_ID) | 317 | if (info->add_set.index != IPSET_INVALID_ID) |
316 | ip_set_add(info->add_set.index, skb, par, &add_opt); | 318 | ip_set_add(info->add_set.index, skb, par, &add_opt); |