diff mbox series

[net-next,v2] tcp: remove unnecessary update for tp->write_seq in tcp_connect() Commit 783237e8daf13("net-tcp: Fast Open client - sending SYN-data") introduces tcp_connect_queue_skb() and it would overwrite tcp->write_seq, so it is no need to update tp->w

Message ID 1727999090-19845-1-git-send-email-guoxin0309@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] tcp: remove unnecessary update for tp->write_seq in tcp_connect() Commit 783237e8daf13("net-tcp: Fast Open client - sending SYN-data") introduces tcp_connect_queue_skb() and it would overwrite tcp->write_seq, so it is no need to update tp->w | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: pabeni@redhat.com kuba@kernel.org dsahern@kernel.org
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 5 this patch: 5
netdev/checkpatch fail ERROR: code indent should use tabs where possible ERROR: trailing whitespace WARNING: Missing commit description - Add an appropriate one WARNING: please, no spaces at the start of a line
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 1 this patch: 1
netdev/source_inline success Was 0 now: 0

Commit Message

xin.guo Oct. 3, 2024, 11:44 p.m. UTC
From: "xin.guo" <guoxin0309@gmail.com>

Signed-off-by: xin.guo <guoxin0309@gmail.com>
---
 net/ipv4/tcp_output.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

xin.guo Oct. 3, 2024, 11:55 p.m. UTC | #1
Sorry for this post, please ignore it,



On Fri, Oct 4, 2024 at 7:44 AM xin.guo <guoxin0309@gmail.com> wrote:
>
> From: "xin.guo" <guoxin0309@gmail.com>
>
> Signed-off-by: xin.guo <guoxin0309@gmail.com>
> ---
>  net/ipv4/tcp_output.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 4fd746b..3265f34 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -4133,8 +4133,11 @@ int tcp_connect(struct sock *sk)
>         buff = tcp_stream_alloc_skb(sk, sk->sk_allocation, true);
>         if (unlikely(!buff))
>                 return -ENOBUFS;
> -
> -       tcp_init_nondata_skb(buff, tp->write_seq++, TCPHDR_SYN);
> +
> +        /*SYN eats a sequence byte, write_seq updated by
> +         *tcp_connect_queue_skb()
> +         */
> +       tcp_init_nondata_skb(buff, tp->write_seq, TCPHDR_SYN);
>         tcp_mstamp_refresh(tp);
>         tp->retrans_stamp = tcp_time_stamp_ts(tp);
>         tcp_connect_queue_skb(sk, buff);
> --
> 1.8.3.1
>
diff mbox series

Patch

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 4fd746b..3265f34 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -4133,8 +4133,11 @@  int tcp_connect(struct sock *sk)
 	buff = tcp_stream_alloc_skb(sk, sk->sk_allocation, true);
 	if (unlikely(!buff))
 		return -ENOBUFS;
-
-	tcp_init_nondata_skb(buff, tp->write_seq++, TCPHDR_SYN);
+        
+        /*SYN eats a sequence byte, write_seq updated by
+         *tcp_connect_queue_skb()
+         */
+	tcp_init_nondata_skb(buff, tp->write_seq, TCPHDR_SYN);
 	tcp_mstamp_refresh(tp);
 	tp->retrans_stamp = tcp_time_stamp_ts(tp);
 	tcp_connect_queue_skb(sk, buff);