Skip to content

Commit

Permalink
netfilter: xt_time: fix time's time_mt()'s use of do_div()
Browse files Browse the repository at this point in the history
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 ee4411a
("[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>
  • Loading branch information
David Howells authored and David S. Miller committed Jul 21, 2008
1 parent 5840157 commit 280763c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ time_mt(const struct sk_buff *skb, const struct net_device *in,
__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 */
Expand Down

0 comments on commit 280763c

Please sign in to comment.