Skip to content

Commit

Permalink
[NETFILTER]: xt_time should not assume CONFIG_KTIME_SCALAR
Browse files Browse the repository at this point in the history
It is not correct to assume one can get nsec from a ktime directly by
using .tv64 field.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 13, 2007
1 parent 022cbae commit 5375652
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 @@ -170,7 +170,7 @@ static bool xt_time_match(const struct sk_buff *skb,
if (skb->tstamp.tv64 == 0)
__net_timestamp((struct sk_buff *)skb);

stamp = skb->tstamp.tv64;
stamp = ktime_to_ns(skb->tstamp);
do_div(stamp, NSEC_PER_SEC);

if (info->flags & XT_TIME_LOCAL_TZ)
Expand Down

0 comments on commit 5375652

Please sign in to comment.