Commit 909ef487 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Fix overflow on 64bit in times reported to userspace.

This patch fixes on overflow in tc actions times reported to
userspace on 64 bit architectures. struct tcf_t only contains
32-bit timestamps, but they are initialized to jiffies. When
jiffies is larger than 2^32-1 only the low 32 bit are saved,
and the diff between jiffies and the current timestamp becomes
very large. This happens immediately after boottime since jiffies
is initialized to 2^32-300. It was invisible until now because
only the lower 32bit were reported to userspace, but with the
USER_HZ conversion the reported times start somewhere around
4294967s.

This patch extends the timestamps to 64bit. It breaks userspace
compatibility for actions, but considering that most of this is
not even in iproute yet this should be acceptable.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
ACK'd by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a924291
...@@ -138,9 +138,9 @@ struct tc_police ...@@ -138,9 +138,9 @@ struct tc_police
struct tcf_t struct tcf_t
{ {
__u32 install; __u64 install;
__u32 lastuse; __u64 lastuse;
__u32 expires; __u64 expires;
}; };
struct tc_cnt struct tc_cnt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment