Summary: tcp_respond clamped the free receive space to 65535 and only then applied RCV_SCALE, so scaled ACKs and keepalives advertised a window far smaller than the one actually available. Подробно: The window field of a TCP header is 16 bits wide and, when window scaling is in effect, carries the free space shifted right by RCV_SCALE. The two operations therefore have to happen in that order: shift first, then clamp the result to TCP_max_win. tcp_respond did the opposite. With a receive buffer larger than 64 KiB and RCV_SCALE = 2, free space of 128 KiB was first cut down to 65535 and then shifted to 16383, announcing 64 KiB instead of the full 128 KiB. The larger the buffer and the scale factor, the worse the under-advertisement -- the window only ever shrank, so the effect was lost throughput rather than corruption, but it silently defeated window scaling on exactly the responses that carry the window most often. tcp_output already gets this right (it compares against TCP_max_win shl RCV_SCALE before writing the field); tcp_respond now agrees with it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
KolibriOS
KolibriOS is a hobby operating system for x86-compatible computers, which is currently being developed by a small but passionate team of enthusiasts.
Its kernel, most drivers, and many programs are written entirely in FASM assembly language, making them very compact and lean on system resources.
Based on MenuetOS, it uses its own standards and is NOT fully POSIX or UNIX compliant.
Website
Visit the official KolibriOS website for more information, downloads, and documentation.
Contributing
We would appreciate any participation in the project and always welcome new users and contributors.
Detailed instructions for the contribution process can be found in the contributing guide.
Common list of tasks, issues and enhancement proposals can be found on this page.
Special thanks
The KolibriOS team expresses special thanks to the author of the 32-bit MenuetOS, Ville Turjanmaa. We also want to note that all MenuetOS copyrights have been preserved.