Skip to content

Bound UDP receive buffers to the IPv4 payload limit - #1698

Merged
Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:perf/io-buffer-allocation-20261018
Oct 19, 2026
Merged

Lorenzobattistela merged 2 commits into
bendlang:mainfrom
oxura:perf/io-buffer-allocation-20261018

Conversation

@oxura

@oxura oxura commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1695.

A caller can ask for more bytes than a legal IPv4 datagram can contain. Cap the receive allocation at 65,507 bytes on both backends, without changing truncation or zero-limit errors.

Removed the JS codec and byte-list optimizations following #1644. The reference helpers are unchanged; this PR now just covers UDP capacity.

The real socket regression prints x and abc on Bun and native C. Local repo gate: 54/54. The original largest-payload checks are in #1695; private mini-cluster gates weren’t run.

AI-assisted.

@oxura oxura changed the title perf(io): avoid redundant codec and byte-buffer allocations Bound UDP receive buffers to the IPv4 payload limit Oct 19, 2026
@Lorenzobattistela Lorenzobattistela self-assigned this Oct 19, 2026
@Lorenzobattistela
Lorenzobattistela merged commit 77b2e3b into bendlang:main Oct 19, 2026
1 check passed
@Lorenzobattistela Lorenzobattistela mentioned this pull request Oct 20, 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.

UDP receive buffers grow beyond the maximum IPv4 payload

2 participants