Content-Type: multipart/mixed; boundary="===============3583042562205666699==" MIME-Version: 1.0 From: Christoph Paasch To: mptcp at lists.01.org Subject: [MPTCP] [PATCH 01/18] tcp: Write options after the header has been fully done Date: Tue, 03 Oct 2017 09:21:47 -0700 Message-ID: <20171003162204.17945-2-cpaasch@apple.com> In-Reply-To: 20171003162204.17945-1-cpaasch@apple.com X-Status: X-Keywords: X-UID: 86 --===============3583042562205666699== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This is needed later on for TCP_MD5, as we need the complete TCP-header to compute the TCP_MD5-hash. Signed-off-by: Christoph Paasch --- net/ipv4/tcp_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 0bc9e46a5369..aca05ec7c841 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1073,7 +1073,6 @@ static int tcp_transmit_skb(struct sock *sk, struct s= k_buff *skb, int clone_it, } } = - tcp_options_write((__be32 *)(th + 1), tp, &opts); skb_shinfo(skb)->gso_type =3D sk->sk_gso_type; if (likely(!(tcb->tcp_flags & TCPHDR_SYN))) { th->window =3D htons(tcp_select_window(sk)); @@ -1084,6 +1083,7 @@ static int tcp_transmit_skb(struct sock *sk, struct s= k_buff *skb, int clone_it, */ th->window =3D htons(min(tp->rcv_wnd, 65535U)); } + tcp_options_write((__be32 *)(th + 1), tp, &opts); #ifdef CONFIG_TCP_MD5SIG /* Calculate the MD5 hash, as we have all we need now */ if (md5) { @@ -3187,8 +3187,8 @@ struct sk_buff *tcp_make_synack(const struct sock *sk= , struct dst_entry *dst, = /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window =3D htons(min(req->rsk_rcv_wnd, 65535U)); - tcp_options_write((__be32 *)(th + 1), NULL, &opts); th->doff =3D (tcp_header_size >> 2); + tcp_options_write((__be32 *)(th + 1), NULL, &opts); __TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); = #ifdef CONFIG_TCP_MD5SIG -- = 2.14.1 --===============3583042562205666699==--