All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xuanqiang Luo <xuanqiang.luo@linux.dev>
To: Eric Dumazet <edumazet@google.com>
Cc: Simon Horman <horms@kernel.org>,
	Neal Cardwell <ncardwell@google.com>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next] tcp: remove dead code in tcp_rcv_state_process()
Date: Wed, 23 Sep 2026 09:22:00 +0800	[thread overview]
Message-ID: <c9341953-58e1-498f-a103-16765684eb07@linux.dev> (raw)
In-Reply-To: <20260922010627.2291980-1-edumazet@google.com>

On 2026/9/22 at 09:06 Eric Dumazet wrote:
> Since commit 3d501dd326fb ("tcp: do not accept ACK of bytes we never
> sent"), tcp_ack() bounds the acceptable old ACK window by
> min(tp->max_window, tp->bytes_acked).
> 
> When sk->sk_state == TCP_SYN_RECV, tp->bytes_acked is always 0, so
> any segment with before(ack, prior_snd_una) immediately returns
> -SKB_DROP_REASON_TCP_TOO_OLD_ACK and never reaches the old_ack label
> (which returns 0).
> 
> Therefore, tcp_ack() can only return 0 in closing states (where old
> ACKs are accepted), and can never return 0 in TCP_SYN_RECV.
> 
> Simplify the tcp_ack() return value check in tcp_rcv_state_process()
> to only check for negative return values and remove the unreachable
> !reason branch.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn>

Thanks,
Xuanqiang

  reply	other threads:[~2026-09-23  1:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  1:06 [PATCH net-next] tcp: remove dead code in tcp_rcv_state_process() Eric Dumazet
2026-09-23  1:22 ` Xuanqiang Luo [this message]
2026-09-23  2:10 ` patchwork-bot+netdevbpf

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=c9341953-58e1-498f-a103-16765684eb07@linux.dev \
    --to=xuanqiang.luo@linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.