fix(rudp): preserve success for packets on bound sockets
This commit is contained in:
1 parent
e7a54cb0fc
commit
7fb2d48038
3 files changed
+4
-11
No files matched your search
@@ -577,7 +577,7 @@ int APS5_VABI sceRudpNetReceived(int socketId, const void* data, std::size_t dat
|
||||
GuestCopyIn_nid_no_patch(address, sourceAddress, length);
|
||||
if (!readable) return RUDP_ERROR_INVALID_ARGUMENT;
|
||||
if (!g_sockets.contains(socketId)) return RUDP_ERROR_INVALID_SOCKET;
|
||||
NotImplemented_nid_no_patch(__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int APS5_VABI sceRudpGetMaxSegmentSize(uint16_t* size) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
static void Require(bool value, int line) {
|
||||
@@ -60,13 +59,7 @@ int main() {
|
||||
CHECK(sceRudpBind(context, 7, 0x2711, 2) == 0);
|
||||
CHECK(sceRudpNetReceived(7, &packet, 0, nullptr, 0) == 0);
|
||||
CHECK(sceRudpNetReceived(8, &packet, 1, address, sizeof(address)) == invalidSocket);
|
||||
bool refused = false;
|
||||
try {
|
||||
sceRudpNetReceived(7, &packet, 1, address, sizeof(address));
|
||||
} catch (const std::runtime_error&) {
|
||||
refused = true;
|
||||
}
|
||||
CHECK(refused);
|
||||
CHECK(sceRudpNetReceived(7, &packet, 1, address, sizeof(address)) == 0);
|
||||
CHECK(sceRudpTerminate(context) == 0);
|
||||
CHECK(sceRudpSetMaxSegmentSize(1000) == 0);
|
||||
CHECK(sceRudpEnd() == 0);
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
- [sceRudpProcessEvents and sceRudpNetFlush](../../../core/libs/prx/libSceRudp/Export.cpp) (libSceRudp) return success after initialization and `RUDP_ERROR_NOT_INITIALIZED` before it, following [shadPS4](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/rudp/rudp.cpp). The host does not queue or send RUDP packets. PPSA03490 calls `sceRudpProcessEvents(0)` followed by `sceRudpNetFlush()` from its P2P service thread and ignores the first result.
|
||||
|
||||
## add Unknown function info
|
||||
## add Silent stubs
|
||||
|
||||
- [sceRudpNetReceived](../../../core/libs/prx/libSceRudp/Export.cpp) (libSceRudp) throws for nonempty packets on a bound socket. The [firmware 13.42 harness](https://github.com/boykopovar/AnyPS5/issues/13682#issuecomment-6932414678) reported `0x8077001b` for three malformed packets. The packet validation rules and delivery to a virtual port remain unknown. The argument and socket checks follow that harness. An unreadable source address returns the host safety error `0x80770004`; console fault behavior is unverified.
|
||||
- [sceRudpNetReceived](../../../core/libs/prx/libSceRudp/Export.cpp) (libSceRudp) discards nonempty packets on a bound socket and returns 0 after the argument and socket checks. The [firmware 13.42 harness](https://github.com/boykopovar/AnyPS5/issues/13682#issuecomment-6932414678) returned `0x8077001b` for three malformed packets. General packet validation, delivery and the result for a well-formed packet remain unverified. An unreadable source address returns the host safety error `0x80770004`.
|
||||
Reference in new issue
Block a user