From patchwork Mon Jul 9 08:58:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 169717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AF4D72C0205 for ; Mon, 9 Jul 2012 18:58:37 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752299Ab2GII6d (ORCPT ); Mon, 9 Jul 2012 04:58:33 -0400 Received: from mail.us.es ([193.147.175.20]:56484 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357Ab2GII6c (ORCPT ); Mon, 9 Jul 2012 04:58:32 -0400 Received: (qmail 16941 invoked from network); 9 Jul 2012 10:58:29 +0200 Received: from unknown (HELO us.es) (192.168.2.12) by us.es with SMTP; 9 Jul 2012 10:58:29 +0200 Received: (qmail 2871 invoked by uid 507); 9 Jul 2012 08:58:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on antivirus2 X-Spam-Level: X-Spam-Status: No, score=-99.2 required=7.5 tests=BAYES_50,SPF_HELO_FAIL, USER_IN_WHITELIST autolearn=disabled version=3.3.1 Received: from 127.0.0.1 by antivirus2 (envelope-from , uid 501) with qmail-scanner-2.08 (clamdscan: 0.97.5/15119. Clear:RC:1(127.0.0.1):. Processed in 0.152728 secs); 09 Jul 2012 08:58:28 -0000 Received: from unknown (HELO antivirus2) (127.0.0.1) by us.es with SMTP; 9 Jul 2012 08:58:28 -0000 Received: from 192.168.1.13 (192.168.1.13) by antivirus2 (F-Secure/fsigk_smtp/407/antivirus2); Mon, 09 Jul 2012 10:58:28 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/407/antivirus2) Received: (qmail 31412 invoked from network); 9 Jul 2012 10:58:27 +0200 Received: from 1984.lsi.us.es (HELO us.es) (1984lsi@150.214.188.80) by us.es with AES128-SHA encrypted SMTP; 9 Jul 2012 10:58:27 +0200 Date: Mon, 9 Jul 2012 10:58:27 +0200 From: Pablo Neira Ayuso To: David Miller Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 1/2] netfilter: ipset: timeout fixing bug broke SET target special timeout value Message-ID: <20120709085827.GA10776@1984> References: <1341574779-3373-1-git-send-email-pablo@netfilter.org> <1341574779-3373-2-git-send-email-pablo@netfilter.org> <20120709.002903.592402805831614695.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120709.002903.592402805831614695.davem@davemloft.net> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org On Mon, Jul 09, 2012 at 12:29:03AM -0700, David Miller wrote: > From: pablo@netfilter.org > Date: Fri, 6 Jul 2012 13:39:38 +0200 > > > + if (add_opt.timeout != IPSET_NO_TIMEOUT > > + && add_opt.timeout > UINT_MAX/MSEC_PER_SEC) > > We do not write conditionals like this, with operators beginning > a continued line. Instead, write this as: > > if (a && > b) Oops, indeed, sorry. New patch attached. I've also rebased my tree to include this change. Should I send a new pull request? Let me know what you prefer. From a73f89a61f92b364f0b4a3be412b5b70553afc23 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 29 Jun 2012 09:42:28 +0000 Subject: [PATCH] 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 Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso --- net/netfilter/xt_set.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c index 035960e..c6f7db7 100644 --- a/net/netfilter/xt_set.c +++ b/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); -- 1.7.10