netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kodanev <alexey.kodanev@oracle.com>
To: David Miller <davem@davemloft.net>,
	Florian Westphal <fw@strlen.de>,
	Eric Dumazet <edumazet@google.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/2] tcp: setup random timestamp offset when write_seq already set
Date: Sat, 18 Feb 2017 12:19:04 +0300	[thread overview]
Message-ID: <309e3579-8cdb-ca96-f995-5629fa132e5c@oracle.com> (raw)
In-Reply-To: <1487379372-28199-1-git-send-email-alexey.kodanev@oracle.com>

Hi,
On 18.02.2017 3:56, Alexey Kodanev wrote:
> Found that when random offset enabled (default) TCP client can
> still start new connections with and without random offsets. Later,
> if server does active close and re-use sockets in TIME-WAIT state,
> new SYN from client can be rejected on PAWS check inside
> tcp_timewait_state_process().
>

Actually, on second thoughts, we can just copy tsoffset from tw socket:

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 89a95da..f40a61d 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -126,6 +126,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock
*sktw, void *twp)
                        tp->write_seq = 1;
                tp->rx_opt.ts_recent       = tcptw->tw_ts_recent;
                tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;
+               tp->tsoffset               = tcptw->tw_ts_offset;
                sock_hold(sktw);
                return 1;
        }

Will test this and send a new version.

Thanks,
Alexey

  parent reply	other threads:[~2017-02-18  9:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-18  0:56 [PATCH 1/2] tcp: setup random timestamp offset when write_seq already set Alexey Kodanev
2017-02-18  0:56 ` [PATCH 2/2] tcp: account for ts offset only if tsecr not zero Alexey Kodanev
2017-02-18  9:19 ` Alexey Kodanev [this message]
2017-02-20 15:18 ` [PATCH 1/2] tcp: setup random timestamp offset when write_seq already set David Miller
2017-02-20 16:29   ` Alexey Kodanev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=309e3579-8cdb-ca96-f995-5629fa132e5c@oracle.com \
    --to=alexey.kodanev@oracle.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).