From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo Neira Ayuso Subject: Re: [PATCH] netfilter: ctnetlink: fix timeout calculation Date: Sat, 31 Dec 2011 16:58:12 +0100 Message-ID: <20111231155812.GB17114@1984> References: <1325259617-22034-1-git-send-email-xi.wang@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Patrick McHardy , "David S. Miller" , netfilter-devel@vger.kernel.org, netdev@vger.kernel.org To: Xi Wang Return-path: Received: from mail.us.es ([193.147.175.20]:55564 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753179Ab1LaP6Q (ORCPT ); Sat, 31 Dec 2011 10:58:16 -0500 Content-Disposition: inline In-Reply-To: <1325259617-22034-1-git-send-email-xi.wang@gmail.com> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Fri, Dec 30, 2011 at 10:40:17AM -0500, Xi Wang wrote: > The sanity check (timeout < 0) never works; the dividend is unsigned > and so is the division, which should have been a signed division. > > long timeout = (ct->timeout.expires - jiffies) / HZ; > if (timeout < 0) > timeout = 0; > > This patch converts the time values to signed for the division. > > Signed-off-by: Xi Wang Applied, thanks.