Skip to content

fix(e2e): read the macOS ephemeral port range for UDP claims - #2942

Merged
thiras merged 2 commits into
mainfrom
fix/2787-macos-ephemeral-range
Nov 24, 2026
Merged

thiras merged 2 commits into
mainfrom
fix/2787-macos-ephemeral-range

Conversation

@yigitdot

Copy link
Copy Markdown
Contributor

Off Linux, ephemeral_low() returned a fixed 49152, so on a Mac with a tuned net.inet.ip.portrange.first a UdpPortClaim could land inside the real ephemeral range and race with bind(…:0).

  • macOS reads sysctl -n net.inet.ip.portrange.first; Linux still reads /proc; other targets keep 49152. udp_bind_to_port_zero_never_lands_below_ephemeral_low now checks that read against the kernel on macOS too.
  • UdpPortClaim::new delegates to a private claim_in(low, high), and a new test covers the "no free UDP port after N picks" error.

Still open on #2787 (Linux-only or needs a decision): the /proc read-failure test, the EPHEMERAL_PICKS doc figure, and node_style_listen copying the daemon's bind.

Part of #2787

Copilot AI balanced review requested due to automatic review settings November 23, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-code-quality

github-code-quality Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main cec7f1c fix/2787-macos-ephem... 81eb970 +/-
77% 77% 0%
View coverage of the 3 most impacted files.
File main cec7f1c fix/2787-macos-ephem... 81eb970 +/-
crates/e2e/src/ports.rs 96% 84% -12%
crates/protocol/src/framing.rs 93% 92% -1%
crates/node/src...s/client/mod.rs 88% 88% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 23, 2026 01:46 UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the macOS ephemeral-port allocation update.

No open issues 🎉

Review effort: Balanced

@thiras
thiras requested a balanced review from Copilot and removed request for Copilot November 24, 2026 23:32
@thiras
thiras merged commit e0455c9 into main Nov 24, 2026
38 of 39 checks passed
@thiras
thiras deleted the fix/2787-macos-ephemeral-range branch November 24, 2026 23:33
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.

3 participants