Re: [PATCH] tcp: initialize rcv_tstamp for restored sockets

2013-08-29 Thread David Miller
From: Andrey Vagin 
Date: Tue, 27 Aug 2013 12:20:40 +0400

> From: Andrew Vagin 
> 
> u32 rcv_tstamp; /* timestamp of last received ACK */
> 
> Its value used in tcp_retransmit_timer, which closes socket
> if the last ack was received more then TCP_RTO_MAX ago.
> 
> Currently rcv_tstamp is initialized to zero and if tcp_retransmit_timer
> is called before receiving a first ack, the connection is closed.
> 
> This patch initializes rcv_tstamp to a timestamp, when a socket was
> restored.
> 
> Reported-by: Cyrill Gorcunov 
> Signed-off-by: Andrey Vagin 

Applied and queued up for -stable.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] tcp: initialize rcv_tstamp for restored sockets

2013-08-29 Thread David Miller
From: Andrey Vagin ava...@openvz.org
Date: Tue, 27 Aug 2013 12:20:40 +0400

 From: Andrew Vagin ava...@openvz.org
 
 u32 rcv_tstamp; /* timestamp of last received ACK */
 
 Its value used in tcp_retransmit_timer, which closes socket
 if the last ack was received more then TCP_RTO_MAX ago.
 
 Currently rcv_tstamp is initialized to zero and if tcp_retransmit_timer
 is called before receiving a first ack, the connection is closed.
 
 This patch initializes rcv_tstamp to a timestamp, when a socket was
 restored.
 
 Reported-by: Cyrill Gorcunov gorcu...@openvz.org
 Signed-off-by: Andrey Vagin ava...@openvz.org

Applied and queued up for -stable.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] tcp: initialize rcv_tstamp for restored sockets

2013-08-27 Thread Andrey Vagin
From: Andrew Vagin 

u32 rcv_tstamp; /* timestamp of last received ACK */

Its value used in tcp_retransmit_timer, which closes socket
if the last ack was received more then TCP_RTO_MAX ago.

Currently rcv_tstamp is initialized to zero and if tcp_retransmit_timer
is called before receiving a first ack, the connection is closed.

This patch initializes rcv_tstamp to a timestamp, when a socket was
restored.

Cc: Pavel Emelyanov 
Cc: Eric Dumazet 
Cc: "David S. Miller" 
Cc: Alexey Kuznetsov 
Cc: James Morris 
Cc: Hideaki YOSHIFUJI 
Cc: Patrick McHardy 
Reported-by: Cyrill Gorcunov 
Signed-off-by: Andrey Vagin 
---
 net/ipv4/tcp_output.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 92fde8d..e297299 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2814,6 +2814,8 @@ void tcp_connect_init(struct sock *sk)
 
if (likely(!tp->repair))
tp->rcv_nxt = 0;
+   else
+   tp->rcv_tstamp = tcp_time_stamp;
tp->rcv_wup = tp->rcv_nxt;
tp->copied_seq = tp->rcv_nxt;
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] tcp: initialize rcv_tstamp for restored sockets

2013-08-27 Thread Andrey Vagin
From: Andrew Vagin ava...@openvz.org

u32 rcv_tstamp; /* timestamp of last received ACK */

Its value used in tcp_retransmit_timer, which closes socket
if the last ack was received more then TCP_RTO_MAX ago.

Currently rcv_tstamp is initialized to zero and if tcp_retransmit_timer
is called before receiving a first ack, the connection is closed.

This patch initializes rcv_tstamp to a timestamp, when a socket was
restored.

Cc: Pavel Emelyanov xe...@parallels.com
Cc: Eric Dumazet eric.duma...@gmail.com
Cc: David S. Miller da...@davemloft.net
Cc: Alexey Kuznetsov kuz...@ms2.inr.ac.ru
Cc: James Morris jmor...@namei.org
Cc: Hideaki YOSHIFUJI yoshf...@linux-ipv6.org
Cc: Patrick McHardy ka...@trash.net
Reported-by: Cyrill Gorcunov gorcu...@openvz.org
Signed-off-by: Andrey Vagin ava...@openvz.org
---
 net/ipv4/tcp_output.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 92fde8d..e297299 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2814,6 +2814,8 @@ void tcp_connect_init(struct sock *sk)
 
if (likely(!tp-repair))
tp-rcv_nxt = 0;
+   else
+   tp-rcv_tstamp = tcp_time_stamp;
tp-rcv_wup = tp-rcv_nxt;
tp-copied_seq = tp-rcv_nxt;
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/