Skip to content

Restore TCP segmentation settings for the new route - #16666

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:review/tcp-restore-gso-route
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:review/tcp-restore-gso-route

Conversation

@tamird

@tamird tamird commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

An established TCP connection restores its route before transmitting
queued data. When the new route supported segmentation offload and its
MTU still permitted the negotiated segment size, the sender kept that
size but left the new route's segmentation size at zero. The first
software-segmented write then divided by zero.

Rebuild the offload settings from the new route and set its segment size
before applying the route's MTU. The regression queues data behind a
closed receive window, checkpoints the connection, and opens the window
after restore. It checks the transmitted bytes with segmentation still
enabled, newly enabled, newly disabled, and with a smaller MTU.

Reconnecting a migrated TCP endpoint replaces its GSO settings. If the
new MTU allows the existing segment size, updateMaxPayloadSize returns
without setting MSS. Software segmentation then divides by zero on
the first queued write. Reset the capabilities from the new route and
bind the sender’s negotiated MSS before applying its MTU.
@tamird

tamird commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@riverafernando, could you review how TCP restores the segmentation settings for a new route? Even when the saved MSS still fits, the route needs its own segment size before the first queued write. Otherwise software segmentation divides by zero. The migration test covers all four route combinations.

Posted by Codex on behalf of @tamird.

@tamird

tamird commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@kerumeto, could you review the changes to pkg/tcpip/transport/tcp/ in this PR? You worked in this directory in #14458.

Posted by Codex on behalf of @tamird.

github-actions Bot added a commit to tamird/gvisor that referenced this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant