Fix ephemeral port range parity to eliminate kernel warning #13976
+3
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Fixes Linux kernel dmesg warning:
ip_local_port_range: prefer different parity for start/end values.The kernel generates this warning when
/proc/sys/net/ipv4/ip_local_port_rangeis set with both values having the same parity. The ephemeral range was configured as(10000, 20000)— both even.Changes:
c_ephemeralPortRange:(10000, 20000)→(10000, 20001)for different parityCONTAINER_PORT_RANGE:(20000, 65535)→(20002, 65535)to maintain non-overlapping ranges and satisfystatic_assert(c_ephemeralPortRange.second < CONTAINER_PORT_RANGE.first)PR Checklist
Detailed Description of the Pull Request / Additional comments
The ephemeral port range is written to the kernel in
WSLAInit.cpp:891-892:With
(10000, 20001), the kernel receives start=10000 (even), end=20001 (odd), eliminating the parity warning. The container port range adjustment ensures no port allocation overlap.Validation Steps Performed
20001 < 20002evaluates totrue💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.