Bug 82101 - Strange code in /net/ipv4/tcp_output.c: tcp_send_syn_data()
Summary: Strange code in /net/ipv4/tcp_output.c: tcp_send_syn_data()
Status: RESOLVED CODE_FIX
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-10 14:37 UTC by Maks Naumov
Modified: 2015-01-23 14:26 UTC (History)
1 user (show)

See Also:
Kernel Version: 3.16.0
Tree: Mainline
Regression: No


Attachments

Description Maks Naumov 2014-08-10 14:37:47 UTC
tcp_output.c 3015

/* Queue a data-only packet after the regular SYN for retransmission */
data = pskb_copy(syn_data, sk->sk_allocation);
if (data == NULL)
  goto fallback;
TCP_SKB_CB(data)->seq++;
TCP_SKB_CB(data)->tcp_flags &= ~TCPHDR_SYN;            // <===
TCP_SKB_CB(data)->tcp_flags = (TCPHDR_ACK|TCPHDR_PSH); // <===
tcp_connect_queue_skb(sk, data);
fo->copied = data->len;

This code intriduced in "net-tcp: Fast Open client - sending SYN-data"
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=783237e8daf13481ee234997cbbbb823872ac388
Comment 1 Maks Naumov 2014-08-18 10:27:47 UTC
Maybe it should be:

TCP_SKB_CB(data)->seq++;
TCP_SKB_CB(data)->tcp_flags &= ~TCPHDR_SYN;
TCP_SKB_CB(data)->tcp_flags |= (TCPHDR_ACK|TCPHDR_PSH);

?
Comment 2 Yuchung Cheng 2014-08-21 18:46:50 UTC
Indeed that's what I intended. I can send a patch to address this. thanks for catching that.

Note You need to log in before you can comment on or make changes to this bug.