Re: [PATCH net] tcp: keep the route window metric when SO_RCVBUF is set before connect
From: shashank Jain
Date: Sun Oct 11 2026 - 01:26:37 EST
The issue was found by manual code inspection assisted by an LLM
(Claude Code, Claude Opus), while reviewing the networking changes that
set window_clamp on unconnected sockets, and then confirmed with a
reproducer before posting. The patch carries an "Assisted-by: LLM" tag
for that reason.
Reproducer: mainline a5ebb76233b7 built for x86_64 and booted in qemu,
two network namespaces joined by a veth pair, with
"ip route replace 10.0.0.0/24 dev <veth> window 4096" on both sides. A
small program sets SO_RCVBUF before connect()/listen() and reads
TCP_WINDOW_CLAMP and tcp_info, and the SYN/SYN-ACK is captured with
tcpdump.
Without SO_RCVBUF the route's window metric is applied
(TCP_WINDOW_CLAMP=4096, rcv_wscale=0, SYN "win 2920, wscale 0"). With
SO_RCVBUF set before connect, mainline reports TCP_WINDOW_CLAMP ~1 MB
and rcv_wscale=5, i.e. the route metric is ignored. Reverting
b025461303d8 ("tcp: update window_clamp when SO_RCVBUF is set") or
applying this patch restores TCP_WINDOW_CLAMP=4096 and the scaled-down
SYN window; with no route metric configured, mainline, the revert and
the patch behave identically in all four combinations.
Thanks,
Shashank
On Sun, Oct 11, 2026 at 10:54 AM <netdev-bot+sinfo@xxxxxxxxxx> wrote:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.