Commit Graph
242 Commits
Author SHA1 Message Date
Dean 9a56a77d16 Merge pull request #11968 from milescoviello/docs/net-unsupported-socket-options
docs(libSceNet): list the socket-level options titles set that sceNetSetsockopt refuses
2026-11-03 01:28:32 +13:00
Dean 3c3b3cda73 Merge pull request #14990 from xXPBSXx/docs-net-resolver-create-flags
docs(debt): say that sceNetResolverCreate fails non-zero flags and what the titles pass
2026-11-02 23:31:18 +13:00
Dean 459f61ea02 Merge pull request #9578 from EagleBearerYS/feat/libscenet-ex-forwards
feat(libSceNet): implement the Ex and Internal socket forms, sceNetSysctl, scope-ID text and the default route
2026-11-02 23:25:39 +13:00
Dean b11adc9d2a Merge pull request #9932 from ntamas94/fix/ps4-net-sockinfo-recv-queue
fix(libSceNet): report the receive queue length in sceNetGetSockInfo
2026-11-02 20:59:28 +13:00
xXPBSXxandClaude Sonnet 5.5 975bebaef1 docs(debt): say that sceNetResolverCreate fails non-zero flags and what the titles pass
sceNetResolverCreate returns EINVAL for any non-zero flags, as the
module is read in prosper. The new entry says so and that no direct call
in the titles checked passes a non-zero value.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 07:49:31 +01:00
xXPBSXxandClaude Opus 5.5 02dd6ca590 docs(debt): name the resolver arguments that titles pass
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 01:53:22 +01:00
Yunus Shaikhandrooklz 0a4d4e792c fix(libSceNet): answer sceNetConfigGetDefaultRoute as the module does
rooklz read sceNetConfigGetDefaultRoute (NID lFJb+BlPK1c, wrapper at
0x153f0) in libSceNet.sprx. Before sceNetInit it returns 0x804101C8
with errno 200. Without a default route it returns 0x8041130C and
leaves the output alone. With one it stores the route and returns 1,
not 0. The wrapper never checks the output pointer.

The not-initialized answer reads the library's sceNetInit/sceNetTerm
flag through fail(), as the other exports do. The route is still the
host gateway. A null output with a route throws std::invalid_argument,
where the module faults.

Co-authored-by: rooklz <[email protected]>
2026-11-01 23:21:53 +00:00
Yunus Shaikhandrooklz 81bc358860 fix(libSceNet): take interface-name zones in the scope-ID text forms
rooklz read sceNetInetNtopWithScopeId (FUN_00006be0) and
sceNetInetPtonWithScopeId (FUN_000072d0) in libSceNet.sprx. The zone
after '%' is one of the ten interface names, never a number, and ntop
prints the name of the interface whose index is the scope. A null
address or text and a short buffer set ENOSPC, and another family sets
EAFNOSUPPORT. Pton reads a zone only when the scope output is not null,
and answers another family with EAFNOSUPPORT and a null text with
EINVAL.

The host has none of these interfaces. Names and indexes go through the
interface table and host-index mapping of rooklz's "feat(net): resolve
interface ids to host indexes", taken with the same text so the two
changes merge without conflict there. A null destination throws
std::invalid_argument, where the module faults.

Co-authored-by: rooklz <[email protected]>
2026-11-01 23:21:53 +00:00
Dean Galvin ee5677e10f Merge main into fix/ps4-net-sockinfo-recv-queue 2026-11-01 18:45:38 +13:00
zaryabzip ce093095ff fix(libSceNet): refuse resolver timeouts below one second as firmware 13.42 does
sceNetResolverStartNtoa refuses a timeout from 1 to 999999 with EINVAL
before the resolver is looked up, and takes 0 as 1000000, as a run of
firmware 13.42's module shows.
2026-10-31 14:20:43 +05:00
Adrià 1c3a42c39f Merge pull request #13234 from kyon-eth/feat/net-320-exports
feat(libSceNet): declare 8 callable exports
2026-10-31 00:10:04 +01:00
Dean 1cf521c1da Merge pull request #12665 from xXPBSXx/docs/net-inet-pton-family
docs(debt): record the address family titles pass to sceNetInetPton and sceNetInetNtop
2026-10-30 22:50:24 +13:00
Kyon 1a01acf0c4 feat(libSceNet): declare 8 callable exports 2026-10-30 07:22:20 +00:00
Adrià 465f290646 Merge pull request #12455 from jagrat04/feat/libSceNet-set-dns-info-to-kernel
feat(libSceNet): track sceNetSetDnsInfoToKernel gap and test throw
2026-10-29 14:39:50 +01:00
Dean d466d63b24 Merge pull request #11966 from milescoviello/docs/net-ipv6-v6only-titles
docs(libSceNet): note that Crimson Desert disables IPV6_V6ONLY
2026-10-30 02:33:01 +13:00
Yunus Shaikh e88598fd9e Merge main into feat/libscenet-ex-forwards 2026-10-28 22:59:25 -07:00
xXPBSXxandClaude Opus 5.5 f744a54063 docs(debt): name what the send flags count leaves unread
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 05:32:41 +01:00
xXPBSXxandClaude Opus 5.5 ecaec7b2e6 docs(debt): state that the send flags count reads only the executables
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 04:58:52 +01:00
xXPBSXxandClaude Opus 5.5 ae4fbac236 docs(debt): count the flags local titles pass to sceNetSend and sceNetSendto
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 04:29:37 +01:00
xXPBSXxandClaude Sonnet 5.5 c1ec0f19d6 docs(debt): record the address family titles pass to sceNetInetPton and sceNetInetNtop
The entry says the IPv6 text conversion of both exports is unverified on a
console. Add how the 53 locally run titles call them: 36 titles call
sceNetInetPton at 107 call sites and 22 call sceNetInetNtop at 67, and every
call site loads the family 2 (AF_INET) into the first argument; none loads 28
(AF_INET6). Read from the instructions of the titles' own executables, not
measured.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-29 00:51:35 +01:00
jagrat Singh f7ed67b7d3 feat(libSceNet): track sceNetSetDnsInfoToKernel gap and test throw 2026-10-28 20:47:07 +05:30
MarcZX10 c1e321f26d feat(libSceNet): implement sceNetGetStatisticsInfo
sceNetGetStatisticsInfo threw NotImplemented_nid_no_patch. It now fills
the six 32-bit fields of the statistics block (kernel memory free and
minimum free, packet count, QoS packet count, library memory free and
minimum free) and fails with NET_EFAULT, setting errno, for a null
pointer. The layout and the "plenty free, nothing queued" answer follow
shadPS4's net.cpp and net_types.h; the host has no counter for the
console's network memory, so the values are not measured. The debt file
records this, and the test checks the null pointer, the field
invariants and that the flags argument is ignored.
2026-10-28 13:07:48 +00:00
MarcZX10 d7c13a621e feat(libSceNet): implement the pool-checked Show*WithMemory diagnostics
sceNetShowIfconfigWithMemory, sceNetShowPolicyWithMemory and
sceNetShowRoute6WithMemory threw NotImplemented_nid_no_patch. They now
behave like the existing sceNetShowRouteWithMemory: an unknown memory
pool id fails with NET_EBADF (errno set), a live pool returns success
without printing. The behaviour follows shadPS4's net.cpp, which does
the same for these three. The new silent stubs are listed in the
libSceNet technical debt file, and the tests cover the invalid id, live
pool and destroyed pool cases.
2026-10-28 13:07:48 +00:00
Yunus Shaikh 8c13ac3865 Merge main into feat/libscenet-ex-forwards
# Conflicts:
#	core/libs/prx/libSceNet/Export.cpp
2026-10-28 01:57:32 -07:00
frankea 2129d1f7b5 fix(libSceNet): print the interface and socket tables from sceNetShowIfconfig and sceNetShowNetstat
Since #9137 both throw after sceNetInit. A PS5 on firmware 13.40
returns 0 from each and prints plain-text tables to stdout. They now
print the console's layout with what the emulator knows: ifconfig an
eth0 block from the host interface sceNetCtlGetInfo reports (the same
MAC, address, netmask and MTU), the console's lo0 block and the DNS
servers; netstat the header and one entry per socket and epoll of the
title, with the self and non-blocking flags, addresses, buffer sizes and
the names given to sceNetSocket and sceNetEpollCreate, which are now
kept. The debt entry lists what the console prints that is left out.

guest_sce_net captures both outputs: the lo0 block and DNS section, a
named unbound UDP socket, a non-blocking listening TCP socket bound to
127.0.0.1, an epoll, a 40-character name cut to 31, and the entries gone
after close.
2026-10-28 09:05:58 +01:00
Yunus Shaikh f051532324 Merge main into feat/libscenet-ex-internal-scope
# Conflicts:
#	core/libs/prx/libSceNetCtl/Export.cpp
2026-10-27 20:25:19 -07:00
milescovielloandClaude Opus 5.5 50fd1824e2 docs(libSceNet): name titles by PPSA id and add the second SO_REUSEPORT caller
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 23:10:48 +00:00
milescovielloandClaude Opus 5.5 99a2d689a8 docs(libSceNet): list the socket-level options titles set that sceNetSetsockopt refuses
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:05:49 +00:00
milescovielloandClaude Opus 5.5 1f3ff3dde5 docs(libSceNet): note that Crimson Desert disables IPV6_V6ONLY
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 14:02:50 +00:00
Adrià ddd72f488b Merge pull request #10628 from maximilianfv/fix/libscenet-macos-datagram-fionread
fix(libSceNet): count only datagram bytes in sceNetIoctl FIONREAD on macOS
2026-10-27 05:38:46 +01:00
Adrià 9a32d83b65 Merge pull request #11155 from xXPBSXx/docs/debt-net-ntoamultiplerecords-title
docs(debt): note how titles call sceNetResolverStartNtoaMultipleRecords
2026-10-27 04:51:35 +01:00
Dean d9c7bb5ffe Merge pull request #11242 from parl0v/fix/epoll-kernel-sockets
fix(libSceNet): register libkernel sockets with sceNetEpollControl
2026-10-27 11:05:08 +13:00
Dean 998e9e5da4 Merge pull request #11037 from Bram910/fix/net-send-nosignal
fix(libSceNet): accept MSG_NOSIGNAL in send, sendto and sendmsg
2026-10-27 10:59:36 +13:00
Dean 77d9056574 Merge pull request #10949 from AZLisme/feat/net-ipv6only
feat(libSceNet): support IPv6 dual-stack socket options
2026-10-27 10:57:32 +13:00
Dean 43c0841507 Merge pull request #10881 from EagleBearerYS/feat/scenet-config-and-ether-calls
feat(libSceNet): implement sceNetInitParam and the loopback answer of sceNetConfigGetIfFlags
2026-10-27 09:07:50 +13:00
Adrià 51f5c57dd9 Merge pull request #10097 from xXPBSXx/docs/debt-net-getsockopt-title
docs(debt): note how a title uses the sceNetGetsockopt error value
2026-10-26 15:08:20 +01:00
Queuze eebedb6427 feat(libSceNet): receive urgent TCP data inline 2026-10-26 14:03:15 +01:00
xXPBSXx 10624a6ad1 Merge main (5e90e7569d) into docs/debt-net-getsockopt-title 2026-10-26 13:18:13 +01:00
Adrià 0c6a6be7fe Merge pull request #9542 from Queuse/codex/net-boolean-readback
feat(libSceNet): read reuse and broadcast flags
2026-10-26 12:58:12 +01:00
AZLisme 5f332dcaed feat(libSceNet): support IPv6-only socket configuration 2026-10-26 19:16:52 +08:00
Bram910 98c0bc2d4e Merge origin/main into fix/net-send-nosignal 2026-10-26 12:11:05 +01:00
Adrià 4b1a9a3b2f Merge pull request #9525 from Queuse/codex/net-socket-state
feat(libSceNet): expose socket type and listen state
2026-10-26 12:01:27 +01:00
Adrià 637575b493 Merge pull request #9733 from mugurc/fix/libscenet-stream-sends-macos
fix(libSceNet): keep MSG_DONTWAIT and aborted stream sends short on macOS hosts
2026-10-26 11:41:14 +01:00
Yunus Shaikh 6f3771820a fix(libSceNet): return -1 from sceNetConfigGetIfFlags for an interface number of 10 or more
Firmware 13.42's module looks the name up with sceNetGetIfName, which
has none past 9, then issues SIOCGIFFLAGS on the empty name. That ioctl
fails, and the call returns -1 with the flags untouched. Return the
same instead of throwing. Interfaces 1 to 9 still throw, and the test
no longer asserts that for 1 and 4, which the console answers from the
kernel.

Asked for in oneandonlydean's review, from BunnyFl's read of the
module.
2026-10-25 23:10:45 -07:00
Yunus Shaikh bf0f293edd Merge main into feat/scenet-config-and-ether-calls 2026-10-25 16:23:19 -07:00
Yunus Shaikh 89da0c7455 Merge main into feat/libscenet-ex-forwards 2026-10-25 16:23:05 -07:00
Adrià b76f08cf33 Merge pull request #9727 from KernelPanicNT/fix/net-reject-unsupported-flags
fix(libSceNet): reject the flags and names the module rejects
2026-10-26 00:07:35 +01:00
Josip Parlov 3cbd5a4be3 fix(libkernel): retire epoll registrations of a socket closed with sceKernelClose 2026-10-25 23:35:48 +01:00
Josip Parlov b0ab88d650 fix(libSceNet): register libkernel sockets with sceNetEpollControl
Human Fall Flat (PPSA02429) opens its sockets with libkernel's socket()
and registers them with sceNetEpollControl. libSceNet only looked in its
own socket table, so every ADD and DEL failed with SCE_NET_ERROR_EBADF.
The game retries without pause: on box 2 it made more than 1.6 million
failing calls on 14 descriptors in its first seconds, all of them
libkernel sockets.

sceNetEpollControl now accepts a descriptor libkernel has open as a
socket, as sceNetSocketClose and sceNetSetsockopt already do for MXGP 26
(PPSA30839). sceNetEpollWait looks up the host socket of such a
registration through libkernel after g_mutex is released, because that
lookup asks libSceNet's own table for descriptors libkernel does not
own, and keeps the owner alive across the host poll. libkernel's close()
retires the registrations of the closed socket; a wait drops a
registration whose socket is gone.

guest_sce_net registers a libkernel UDP socket, waits for it to become
readable and then writable, deletes it twice, closes registered sockets
through close() and sceKernelClose and waits again, and checks that a
descriptor that was never open still fails with EBADF.
2026-10-25 23:28:22 +01:00
xXPBSXxandClaude Sonnet 5.5 295bca0455 docs(debt): shorten the sceNetGetsockopt title note below the entry length limit
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 22:27:57 +01:00