blob: 4dac329067ada4c43588904b4b304ce282444c9c [file] [log] [blame]
From oliver@zipernowsky.hu Fri Aug 1 16:59:12 2008
From: David Howells <dhowells@redhat.com>
Date: Thu, 31 Jul 2008 20:48:23 +0200
Subject: netfilter: xt_time: fix time's time_mt()'s use of do_div()
To: David Howells <dhowells@redhat.com>, stable@kernel.org
Cc: "David S.Miller" <davem@davemloft.net>, Patrick McHardy <kaber@trash.net>, Oliver Pinter <oliver.pntr@gmail.com>
Message-ID: <6da87905f11a11e5d4428d5d61c96ca4@zipernowsky.hu>
From: David Howells <dhowells@redhat.com>
[ Upstream commit 280763c053fee297d95b474f2c145990670371e6 ]
Fix netfilter xt_time's time_mt()'s use of do_div() on an s64 by using
div_s64() instead.
This was introduced by patch ee4411a1b1e0b679c99686629b5eab5a072ce49f
("[NETFILTER]: x_tables: add xt_time match").
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
CC: Oliver Pinter <oliver.pntr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
net/netfilter/xt_time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netfilter/xt_time.c
+++ b/net/netfilter/xt_time.c
@@ -173,7 +173,7 @@ time_mt(const struct sk_buff *skb, const
__net_timestamp((struct sk_buff *)skb);
stamp = ktime_to_ns(skb->tstamp);
- do_div(stamp, NSEC_PER_SEC);
+ stamp = div_s64(stamp, NSEC_PER_SEC);
if (info->flags & XT_TIME_LOCAL_TZ)
/* Adjust for local timezone */