feat(libSceNet): return SO_PROTOCOL for raw sockets with an explicit protocol #14902
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14902"
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?
Imported from boykopovar/AnyPS5. Originally posted by edubox on 2026-11-01T23:55:55Z.
What
sceNetGetsockoptthrew forSO_PROTOCOL(0x1016) on every raw socket. It now returns the protocol of the entry FreeBSD'spffindprotoselects: the requested number for the exact raw entries inin_proto.candin6_proto.c, or the wildcard entry'spr_protocol0 for any other nonzero protocol, whichsogetoptreturns. The host mirrors the IPv4 and IPv6 tables.A raw socket created with protocol 0 still throws because its selection is not mapped. FreeBSD's
socreatecallspffindtypefor zero rather thanpffindproto, andrip_attachdoes not reject it, so this is an unsupported path here and not a console rejection. The debt entry now says exactly that.The truncated integer output (up to
*optlen, minimum of 4) and the existing null-pointerEINVALchecks are unchanged.Tested
BUILD_TESTING=ON: builtguest_net_protocol_testsand the newguest_net_raw_protocol_tests; both pass underunshare -Urnafter bringingloup (which grantsCAP_NET_RAW).sceNetSocketcurrently setsIPV6_V6ONLYon raw IPv6 sockets and the host rejects it withEINVAL, which is unrelated to this change.python3 tools/check_conventions.py --base origin/main: passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)