Commit Graph
232 Commits
Author SHA1 Message Date
Dean 9a2020c220 Merge pull request #10425 from Retr0G28/fix/sendfile-nonregular-einval
fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file
2026-10-25 19:29:21 +13:00
Dean b5f669fd0d Merge pull request #10777 from harisibrar1/fix/select-clear-bits-past-nfds
fix(libkernel): clear select bits from nfds to the end of their word
2026-10-25 19:04:39 +13:00
slopgobblercobbler 7239ebb63e fix(libkernel): validate address family against socket family in bind 2026-10-25 02:14:14 +01:00
Dean b7865bbb6b Merge pull request #8344 from Retr0G28/fix/socketpair-getpeername-enotconn
fix(libkernel): return ENOTCONN from getpeername once a socketpair peer closed
2026-10-25 13:28:30 +13:00
harisibrar1andClaude Opus 5.5 a63d961916 fix(libkernel): clear select bits from nfds to the end of their word as FreeBSD copies them out
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 19:55:07 -04:00
Retr0 7a0bbc4897 Merge remote-tracking branch 'origin/main' into fix/sendfile-nonregular-einval
# Conflicts:
#	core/libs/tests/GuestSendfile.cpp
2026-10-25 02:47:13 +03:00
Dean 761cb46f84 Merge pull request #10350 from orezraey/fix/libkernel-socket-receive-flags-measured-ps5
fix(libkernel): keep the TCP flag and IP receive options a PS5 accepts
2026-10-25 12:44:40 +13:00
Retr0 3af8e6d040 Merge remote-tracking branch 'origin/main' into fix/socketpair-getpeername-enotconn
# Conflicts:
#	core/libs/tests/GuestSocketPair.cpp
2026-10-25 02:23:58 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Dean 30be9b428b Merge pull request #10331 from orezraey/fix/libkernel-multicast-membership-measured-ps5
fix(libkernel): join and leave multicast groups as measured on a PS5
2026-10-25 08:03:16 +13:00
orezraeyandClaude Opus 5.5 7c04bd3a43 Merge fix/libkernel-multicast-membership-measured-ps5 into fix/libkernel-socket-receive-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 14:20:50 -03:00
orezraeyandClaude Opus 5.5 c7b39854eb Merge main into fix/libkernel-socket-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 13:57:57 -03:00
Dean dc9f1ef656 Merge pull request #10327 from orezraey/fix/libkernel-tcp-options-measured-ps5
fix(libkernel): keep TCP_MAXSEG and the TCP keepalive options as measured on a PS5
2026-10-25 05:52:56 +13:00
orezraeyandClaude Opus 5.5 a328020e95 Merge main into fix/libkernel-socket-receive-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 12:24:32 -03:00
Dean 2393e2e773 Merge pull request #10320 from orezraey/fix/libkernel-ip-options-measured-ps5
fix(libkernel): keep IP_TTL, IP_TOS and the multicast options as measured on a PS5
2026-10-25 04:18:17 +13:00
Retr0 8f66466e75 Merge remote-tracking branch 'origin/main' into fix/socketpair-getpeername-enotconn 2026-10-24 16:09:19 +03:00
orezraeyandClaude Opus 5.5 d9d84b5912 fix(libkernel): drop a multicast group through INADDR_ANY on any interface
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 10:01:20 -03:00
orezraeyandClaude Opus 5.5 8d28c15ea4 Merge fix/libkernel-socket-flags-measured-ps5 into fix/libkernel-multicast-membership-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:57:22 -03:00
orezraeyandClaude Opus 5.5 2f443f3b88 Merge fix/libkernel-tcp-options-measured-ps5 into fix/libkernel-socket-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:56:35 -03:00
orezraeyandClaude Opus 5.5 d360078c6a Merge fix/libkernel-ip-options-measured-ps5 into fix/libkernel-tcp-options-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:56:27 -03:00
orezraeyandClaude Opus 5.5 55473fb673 fix(libkernel): keep the low byte of an int IP_MULTICAST_LOOP
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 09:55:58 -03:00
Adrià 887a9640b4 Merge pull request #7605 from HQasper/fix/poll-kqueues
fix(libkernel): poll kqueues as kqueue_poll answers
2026-10-24 12:32:33 +02:00
Dean efe844c653 Merge pull request #10308 from orezraey/fix/libkernel-socket-receive-measured-ps5
fix(libkernel): answer zero-length datagram receives and recvmsg flags as measured on a PS5
2026-10-24 20:46:44 +13:00
Dean 83a25ceb71 Merge pull request #9105 from Retr0G28/fix/connect-port0-connected-dgram
fix(libkernel): disconnect a connected datagram socket on connect to port 0
2026-10-24 16:54:25 +13:00
Dean 6fc058f5cf Merge pull request #10302 from orezraey/fix/libkernel-socket-buffers-measured-ps5
fix(libkernel): keep socket buffer sizes and SO_NBIO as measured on a PS5
2026-10-24 15:25:05 +13:00
Dean d8b73e3644 Merge pull request #9273 from DavidSamir/feat/libkernel-sys-pselect
feat(libkernel): implement pselect over select
2026-10-24 12:53:12 +13:00
orezraeyandClaude Opus 5.5 9402457fb7 Merge fix/libkernel-multicast-membership-measured-ps5 into fix/libkernel-socket-receive-flags-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 20:50:51 -03:00
Retr0 68db53d7a5 fix(libkernel): fail sendfile with EINVAL for a file that is not a regular file 2026-10-24 02:44:14 +03:00
orezraeyandClaude Opus 5.5 4dc6530ee0 fix(libkernel): refuse an ip_mreqn with a non-zero address and require the multicast host checks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 17:45:18 -03:00
Dean 7956a166c7 Merge pull request #9108 from Retr0G28/fix/socket-address-length-exact
fix(libkernel): reject socket addresses longer than sockaddr_in or sockaddr_in6 with EINVAL
2026-10-24 09:12:39 +13:00
orezraeyandClaude Opus 5.5 dd27146c27 fix(libkernel): keep the TCP flag and IP receive options a PS5 accepts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:45:11 -03:00
orezraeyandClaude Opus 5.5 062dc00385 fix(libkernel): join and leave multicast groups as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:38:52 -03:00
orezraeyandClaude Opus 5.5 802bcc8d61 fix(libkernel): share a port between SO_REUSEPORT sockets on the host
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:38:45 -03:00
orezraeyandClaude Opus 5.5 122541c7a8 fix(libkernel): keep the SOL_SOCKET flags a PS5 accepts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:20:17 -03:00
orezraeyandClaude Opus 5.5 29f717c607 fix(libkernel): keep TCP_MAXSEG and the TCP keepalive options as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:20:16 -03:00
orezraeyandClaude Opus 5.5 b776394b4f fix(libkernel): keep IP_TTL, IP_TOS and the multicast options as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:20:03 -03:00
orezraeyandClaude Opus 5.5 d8d03c2839 fix(libkernel): give the host the requested socket buffer and test the inherited sizes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:16:09 -03:00
orezraeyandClaude Opus 5.5 9afaeff204 fix(libkernel): answer a zero-length recvmsg on an empty datagram socket
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 15:14:09 -03:00
orezraeyandClaude Opus 5.5 a537c33096 fix(libkernel): answer zero-length datagram receives and recvmsg flags as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 14:09:47 -03:00
orezraeyandClaude Opus 5.5 f334c156e1 fix(libkernel): keep socket buffer sizes and SO_NBIO as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 13:49:03 -03:00
Dean Galvin 2f741e737f Merge main into feat/libkernel-underscore-socket-signal-entries 2026-10-23 22:00:32 +13:00
Dean c9edaff579 Merge pull request #9104 from Retr0G28/fix/sendfile-enotsock
fix(libkernel): return ENOTSOCK from sendfile on a descriptor that is not a socket
2026-10-23 19:25:35 +13:00
Retr0 0ca2e0b4e7 fix(libkernel): return ENOTCONN from getpeername once a socketpair peer closed
getpeername on a socketpair end returned the unnamed AF_UNIX address
even after the other end was closed. In FreeBSD 11, closing an end runs
uipc_detach, whose unp_disconnect and unp_drop clear SS_ISCONNECTED on
both stream and datagram ends, and kern_getpeername then fails with
ENOTCONN. Each end now keeps a weak reference to its peer's socket,
which expires when the peer's last descriptor, duplicates included, is
closed. shutdown leaves the ends connected, as soshutdown does.
2026-10-23 08:21:09 +03:00
HQasperandClaude Opus 5.5 8fd72f02c5 fix(libkernel): poll kqueues as kqueue_poll answers
A kqueue descriptor is ready for POLLIN and POLLRDNORM while one of its
events is triggered and for no other event, as FreeBSD's kqueue_poll
answers; poll threw for it on both hosts. A kqueue cannot be waited on,
so while one is polled poll checks it every millisecond and waits on the
other descriptors in slices of 1 ms. This is the loop Windows already
used for pipes, which Linux now shares.

A kqueue closed during the wait reports POLLNVAL, and one whose number
was reused is polled again with the rest of the timeout, as FreeBSD's
pollrescan looks the descriptor up again.

Depends on #7248.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 18:13:27 +00:00
xXPBSXxandClaude Sonnet 5.5 ff2b4ba4cc fix(libkernel): report EPIPE for a stream send on a connection the peer closed on Windows
sosend_generic fails a send on a socket that can send no more with EPIPE
before it looks at so_error. Winsock reports the same send as WSAECONNABORTED
or WSAECONNRESET, which reached the guest as ECONNABORTED or ECONNRESET.
A stream send now maps both to EPIPE. The send-after-close checks of
guest_tcp, guest_socket_read_write and guest_socket_pair run on Windows too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 19:09:29 +02:00
Retr0 be4fd86249 fix(libkernel): disconnect a connected datagram socket on connect to port 0
FreeBSD 11.4's soconnectat() (sys/kern/uipc_socket.c) disconnects a
connected socket of a protocol without PR_CONNREQUIRED before it calls
pru_connect. udp_disconnect() and udp6_disconnect() drop the peer and
reset the local address, then in_pcbconnect_setup() and in6_pcbladdr()
fail port 0 with EADDRNOTAVAIL, so the socket is left unconnected.
connect to port 0 on a connected datagram socket now dissolves the
association through the AF_UNSPEC disconnect path before failing with 49,
where it kept the old peer. Stream sockets keep EISCONN.
2026-10-22 20:00:13 +03:00
Adrià 8499ea52e5 Merge pull request #8499 from xXPBSXx/fix/sendto-port-zero
fix(libkernel): fail sendto to port 0 from an unbound IPv4 datagram socket with EADDRNOTAVAIL
2026-10-22 17:54:00 +02:00
Adrià 093149c5bd Merge pull request #8483 from xXPBSXx/fix/poll-peer-close-pollin
fix(libkernel): report a stream whose peer closed as readable in poll on Windows
2026-10-22 17:44:27 +02:00
David 375b53d918 refactor(libkernel): move pselect into libkernel
The PS5 3.20 export lists have pselect in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys. The implementation moves unchanged to
libkernel/Socket/src/Pselect.cpp, beside select.
2026-10-21 22:30:43 +01:00
Adrià eaff87674c Merge pull request #8492 from xXPBSXx/fix/recv-after-shutdown-and-empty
fix(libkernel): answer a receive after SHUT_RD or with no buffer without the host
2026-10-21 20:39:37 +02:00