net: report unknown socket options as ENOPROTOOPT on Windows #1159
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1159
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1159/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@popcoder565 on GitHub · 2026-10-07 19:52 UTC · original
popcoder565:fix/net-unknown-socket-options→main· +27 −1 · 2 files · 1 commits · closed without mergingOn Windows, guest SOL_SOCKET options without an explicit translation go straight to Winsock, which numbers most BSD socket options like the guest does. Winsock reports an option number it does not know as WSAEINVAL rather than WSAENOPROTOOPT, so the guest saw EINVAL where the PS5 and the Linux path return ENOPROTOOPT, and kernel_file_system failed on Windows with "Net unknown socket options return protocol-option errors".
Pass through only the BSD socket-level options that Winsock defines and treat any other option number as unknown. Options that reached Winsock before still do, which a new Windows-only check covers.
@coderabbitai[bot] on GitHub · 2026-10-07 20:00 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
673b684f-d4f4-4159-9c97-8a89d98d97cd📥 Commits
Reviewing files that changed from the base of the PR and between
45b6d2c597andf5d8d52a27.📒 Files selected for processing (2)
src/libs/network.cpptests/KernelFileSystemTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
On Windows,
ConvertSocketOptionNamenow passes through recognized BSD socket-level options using their host values. Unrecognized options still return-1. A Windows-only test checks retrieval ofSO_TYPEand setting and retrieval ofSO_REUSEADDR.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
f5d8dThe Windows changes support the tested socket options without introducing an actionable behavior regression. No PR-introduced risk remains that should block merging.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@Nawid3333 on GitHub · 2026-10-07 20:58 UTC · original · reviewed
Tested on Windows 11 (clang-cl 19.1.5, Release):
kernel_file_system_testspasses completely with this PR ("all cases passed"), including the new Windows-only check. Onmainit fails at "Net unknown socket options return protocol-option errors". I also confirmed the cause directly against Winsock:setsockopt/getsockoptwithSOL_SOCKETand option0x7ffffffffail with 10022 (WSAEINVAL), not 10042.@popcoder565 on GitHub · 2026-10-07 21:10 UTC · original
Thanks for check !!
@Nawid3333 on GitHub · 2026-10-07 21:32 UTC · original
no problem
@theantipopau on GitHub · 2026-10-07 23:47 UTC · original
Reproduced and verified on our Windows fork (theantipopau/KytyPS5) against current upstream/main (
420bb51d):Without
f5d8d52a— freshly builtkernel_file_system_tests.exeon Windows (MSVC/clang-cl x64) fails exactly the check this PR targets:The
net_setsockopt/net_getsockoptcalls with guest optname0x7fffffffcome back with a Winsock error that translates to the wrong guest errno instead ofENOPROTOOPT.With
f5d8d52acherry-picked — same fresh-binary run:KernelFileSystemTests: all cases passed, and 13/13 in our local Windows ctest sweep (CI subset +kernel_file_system).Note for maintainers: this test isn't in the
.github/workflows/build.ymlctest-Rsubsets on any platform, so CI can't catch the Windows regression today — worth addingkernel_file_systemto the workflow alongside this fix.@Nawid3333 on GitHub · 2026-10-08 02:40 UTC · original
I’m planning to spend some time improving the regression tests and the test suite in general. I’ll keep this in mind as part of that work and implement it when I get to this area.
Pull request closed