diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2005-10-03 16:57:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-10-03 16:57:23 -0400 |
commit | 325ed8239309cb29f10ea58c5a668058ead11479 (patch) | |
tree | 77386825b72ac44f4f42a942ef78bd1ff924b351 /net/core | |
parent | ddea7be0ec8d1374f0b483a81566ed56ec9f3905 (diff) |
[NET]: Fix packet timestamping.
I've found the problem in general. It affects any 64-bit
architecture. The problem occurs when you change the system time.
Suppose that when you boot your system clock is forward by a day.
This gets recorded down in skb_tv_base. You then wind the clock back
by a day. From that point onwards the offset will be negative which
essentially overflows the 32-bit variables they're stored in.
In fact, why don't we just store the real time stamp in those 32-bit
variables? After all, we're not going to overflow for quite a while
yet.
When we do overflow, we'll need a better solution of course.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/skbuff.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index f80a28785610..0e9431b59fb2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -71,8 +71,6 @@ | |||
71 | static kmem_cache_t *skbuff_head_cache __read_mostly; | 71 | static kmem_cache_t *skbuff_head_cache __read_mostly; |
72 | static kmem_cache_t *skbuff_fclone_cache __read_mostly; | 72 | static kmem_cache_t *skbuff_fclone_cache __read_mostly; |
73 | 73 | ||
74 | struct timeval __read_mostly skb_tv_base; | ||
75 | |||
76 | /* | 74 | /* |
77 | * Keep out-of-line to prevent kernel bloat. | 75 | * Keep out-of-line to prevent kernel bloat. |
78 | * __builtin_return_address is not used because it is not always | 76 | * __builtin_return_address is not used because it is not always |
@@ -1708,8 +1706,6 @@ void __init skb_init(void) | |||
1708 | NULL, NULL); | 1706 | NULL, NULL); |
1709 | if (!skbuff_fclone_cache) | 1707 | if (!skbuff_fclone_cache) |
1710 | panic("cannot create skbuff cache"); | 1708 | panic("cannot create skbuff cache"); |
1711 | |||
1712 | do_gettimeofday(&skb_tv_base); | ||
1713 | } | 1709 | } |
1714 | 1710 | ||
1715 | EXPORT_SYMBOL(___pskb_trim); | 1711 | EXPORT_SYMBOL(___pskb_trim); |
@@ -1743,4 +1739,3 @@ EXPORT_SYMBOL(skb_prepare_seq_read); | |||
1743 | EXPORT_SYMBOL(skb_seq_read); | 1739 | EXPORT_SYMBOL(skb_seq_read); |
1744 | EXPORT_SYMBOL(skb_abort_seq_read); | 1740 | EXPORT_SYMBOL(skb_abort_seq_read); |
1745 | EXPORT_SYMBOL(skb_find_text); | 1741 | EXPORT_SYMBOL(skb_find_text); |
1746 | EXPORT_SYMBOL(skb_tv_base); | ||