Thanks to visit codestin.com
Credit goes to github.com

Skip to content

P2P: Allow broadcast socket#18245

Open
Cri4Key wants to merge 1 commit into
RPCS3:masterfrom
Project-RePSASBR:fix_broadcast_p2p_socket
Open

P2P: Allow broadcast socket#18245
Cri4Key wants to merge 1 commit into
RPCS3:masterfrom
Project-RePSASBR:fix_broadcast_p2p_socket

Conversation

@Cri4Key
Copy link
Copy Markdown

@Cri4Key Cri4Key commented Feb 28, 2026

If a game tries to create a broadcast socket in P2P it will fail, logging sys_net: Socket error EACCES

This fix allows the native socket to have the option broadcast enabled.

@RipleyTom
Copy link
Copy Markdown
Contributor

Does the game set SO_BROADCAST on the p2p socket? And I assume it tries to send to 255.255.255.255?
Nothing against adding this but you also need track the SO_BROADCAST status(similarly to nbio) of each guest p2p socket and validate if (addr == BROADCAST_ADDRESS && !so_broadcast) { return -SYS_NET_EACCES; }

@Cri4Key
Copy link
Copy Markdown
Author

Cri4Key commented Feb 28, 2026

It does yes. Observed on PlayStation All-Stars Battle Royale. Here's the log:

U sys_net TODO: sys_net_infoctl(cmd=53, arg=*0xd0080018)
W sys_net: sys_net_bnet_socket(family=INET, type=DGRAM-P2P, protocol=IPPROTO_IP)
W sys_net: sys_net_bnet_bind(s=24, addr=*0xd0080204, addrlen=16)
! sys_net: [P2P] Trying to bind 0.0.0.0:3658:1002
! IPv6_layer: is_ipv6_supported(): disabled cause: force-disabled through config
! sys_net: P2P port 3658 was bound!
W sys_net: sys_net_bnet_setsockopt(s=24, level=SYS_NET_SOL_SOCKET, optname=SO_NBIO, optval=*0xd0080200, optlen=4)
W sys_net: optval: 0x00000001
W sys_net: sys_net_bnet_socket(family=INET, type=DGRAM-P2P, protocol=IPPROTO_IP)
W sys_net: sys_net_bnet_bind(s=25, addr=*0xd0080204, addrlen=16)
! sys_net: [P2P] Trying to bind 0.0.0.0:3658:1001
W sys_net: sys_net_bnet_setsockopt(s=25, level=SYS_NET_SOL_SOCKET, optname=SO_NBIO, optval=*0xd0080200, optlen=4)
W sys_net: optval: 0x00000001
W sys_net: sys_net_bnet_setsockopt(s=25, level=SYS_NET_SOL_SOCKET, optname=SO_BROADCAST, optval=*0xd0080200, optlen=4)
W sys_net: optval: 0x00000001
E sys_net: Socket error EACCES
E SYS: 'sys_net_bnet_sendto' failed with 0xfffffff3 : -SYS_NET_EACCES [1]
E sys_net: Socket error EACCES
E SYS: 'sys_net_bnet_sendto' failed with 0xfffffff3 : -SYS_NET_EACCES [2]
E sys_net: Socket error EACCES
E SYS: 'sys_net_bnet_sendto' failed with 0xfffffff3 : -SYS_NET_EACCES [3]
E sys_net: Socket error EACCES x2

And it does send to 255.255.255.255, I've already observed the beahviour while capturing packets in working consoles.

@elad335
Copy link
Copy Markdown
Contributor

elad335 commented Mar 4, 2026

It seems like it would be wiser to implement the socket option in lv2_socket_p2p::setsockopt, the game calls it in the log you displayed.

@psychoblue
Copy link
Copy Markdown

@Cri4Key Sorry to revive the thread, for PSABR specifically, if I tell another player to set the IP to 255.255.255.255 in Network settings, would we be able to find each other in-game using the tournament mode?

@elad335 elad335 enabled auto-merge (rebase) April 25, 2026 05:05
@elad335 elad335 disabled auto-merge April 25, 2026 09:45
@elad335 elad335 enabled auto-merge (rebase) April 25, 2026 09:45
@elad335 elad335 disabled auto-merge April 25, 2026 09:46
@elad335
Copy link
Copy Markdown
Contributor

elad335 commented May 8, 2026

You need to enable write-acces from maintainers, I wanted to merge it but I can't because of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants