diff options
author | Andrey Vagin <avagin@openvz.org> | 2013-02-11 06:50:17 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-13 19:22:15 +0100 |
commit | ceaa1fef65a7c2e017b260b879b310dd24888083 (patch) | |
tree | f511458ce6431cd4b5f5b46f4c633f73e49a3589 /net/ipv4/tcp.c | |
parent | Merge branch 'gfar-ethtool-atomic' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
download | linux-ceaa1fef65a7c2e017b260b879b310dd24888083.tar.xz linux-ceaa1fef65a7c2e017b260b879b310dd24888083.zip |
tcp: adding a per-socket timestamp offset
This functionality is used for restoring tcp sockets. A tcp timestamp
depends on how long a system has been running, so it's differ for each
host. The solution is to set a per-socket offset.
A per-socket offset for a TIME_WAIT socket is inherited from a proper
tcp socket.
tcp_request_sock doesn't have a timestamp offset, because the repair
mode for them are not implemented.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2c7e5963c2ea..8a90bda96038 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -400,6 +400,8 @@ void tcp_init_sock(struct sock *sk) tcp_enable_early_retrans(tp); icsk->icsk_ca_ops = &tcp_init_congestion_ops; + tp->tsoffset = 0; + sk->sk_state = TCP_CLOSE; sk->sk_write_space = sk_stream_write_space; |