From: Jozsef Kadlecsik Date: Fri, 8 Jun 2012 08:02:59 +0000 (+0200) Subject: Timeout fixing bug broke SET target special timeout value, fixed X-Git-Tag: v6.13~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed668b564ed32d1784f6a8b25b3c130e0d6a9ee9;p=ipset Timeout fixing bug broke SET target special timeout value, fixed The patch "Fix timeout value overflow bug at large timeout parameters" broke the SET target when no timeout was specified (reported by Jean-Philippe Menil). --- diff --git a/kernel/net/netfilter/xt_set.c b/kernel/net/netfilter/xt_set.c index 035960e..b172cbc 100644 --- a/kernel/net/netfilter/xt_set.c +++ b/kernel/net/netfilter/xt_set.c @@ -16,6 +16,7 @@ #include #include +#include MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jozsef Kadlecsik "); @@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const struct xt_action_param *par) info->del_set.flags, 0, UINT_MAX); /* Normalize to fit into jiffies */ - if (add_opt.timeout > UINT_MAX/MSEC_PER_SEC) + if (add_opt.timeout != IPSET_NO_TIMEOUT + && add_opt.timeout > UINT_MAX/MSEC_PER_SEC) add_opt.timeout = UINT_MAX/MSEC_PER_SEC; if (info->add_set.index != IPSET_INVALID_ID) ip_set_add(info->add_set.index, skb, par, &add_opt);