[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170220.101807.883027207624802826.davem@davemloft.net>
Date: Mon, 20 Feb 2017 10:18:07 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: alexey.kodanev@...cle.com
Cc: netdev@...r.kernel.org, fw@...len.de, edumazet@...gle.com
Subject: Re: [PATCH 1/2] tcp: setup random timestamp offset when write_seq
already set
From: Alexey Kodanev <alexey.kodanev@...cle.com>
Date: Sat, 18 Feb 2017 03:56:11 +0300
> @@ -232,12 +232,17 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
> sk->sk_gso_type = SKB_GSO_TCPV4;
> sk_setup_caps(sk, &rt->dst);
>
> - if (!tp->write_seq && likely(!tp->repair))
> + if (!tp->write_seq && likely(!tp->repair)) {
> tp->write_seq = secure_tcp_sequence_number(inet->inet_saddr,
> inet->inet_daddr,
> inet->inet_sport,
> usin->sin_port,
> &tp->tsoffset);
> + } else if (likely(!tp->repair)) {
> + secure_tcp_sequence_number(inet->inet_saddr, inet->inet_daddr,
> + inet->inet_sport, usin->sin_port,
> + &tp->tsoffset);
> + }
This would be so much easier to understand if it were coded as:
if (!tp->repair) {
seq = secure_tcp_sequence_number(...);
if (!tp->write_seq)
tp->write_seq = seq;
}
Powered by blists - more mailing lists