Repository navigation
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
Contributor
|
A Windows run with GCC 16: Windows 11 Pro 10.0.22631, i9-9900K, MSYS2 UCRT64 GCC 16.1.0, Release, this PR (
AI-assisted: yes (Claude Code) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An address on a socketpair end is handled as FreeBSD 11.4 handles it on a connected
AF_UNIXsocket. Before this PR every such call reportedEAFNOSUPPORTwithout reaching the host, on every host. Three cases differ:connecton a stream or sequenced-packet end whose peer is open now returnsEISCONN.soconnectatreturns it for a connected socket of a connection-oriented protocol before it looks at the address.shutdownleaves the end connected, so this also holds after it. After the peer closes,unp_disconnectdisconnects the end, andconnectstill reportsEAFNOSUPPORT, asunp_connectatdoes for a non-AF_UNIXaddress.sendtoandsendmsgwith an address on a datagram end whose peer is open now returnEISCONN, asuipc_senddoes whenunp_connis set. The check comes after the flag, length and buffer checks and before waiting for send space, which a datagram end never needs inuipc_send. After the end's ownshutdown(SHUT_WR)the send goes to the host and fails withEPIPE, assosend_genericchecksSBS_CANTSENDMOREfirst.sendtoandsendmsgwith an address on a stream or sequenced-packet end now ignore the address and send, asuipc_senddoes on a connected end. Stream ends already did this while the host reported a peer; sequenced-packet ends reportedEAFNOSUPPORT. After the peer closes the host send givesEPIPE, as FreeBSD'ssoisdisconnectedsetsSBS_CANTSENDMORE.The pair end counts as connected while its guest peer object is alive.
dupshares that object, so closing one alias keeps the end connected, as FreeBSD's file reference does.bindkeepsEAFNOSUPPORT, whichuipc_bindatreturns for a non-AF_UNIXaddress.connecton a datagram end is not changed.The libkernel
socketpairdebt entry said all three calls should report the console'sEISCONN. That entry came from #1711, which has no console measurement for it, and FreeBSD's source contradicts it forbindand for an addressed streamsendto. The entry now states the remaining differences:AF_UNIXpath is not resolved:bind, and aconnector addressedsendtothat FreeBSD passes tounp_connect, reportEAFNOSUPPORT.connecton a datagram end keeps it connected. FreeBSD disconnects it first and then fails.unpdg_sendspace) is not refused withEMSGSIZE.The entry was over the 1000-character limit, so it is reworded to fit. Two sentences that describe no difference from the console are dropped:
read/writegoing to the host, and the reason the loopback connection reports noPOLLHUP.Tested
guest_socket_pairgetsCheckAddressOnPairEnd:connectwith anAF_INETaddress returnsEISCONN, also aftershutdown(SHUT_RDWR), andEINVALfor a 1-byte address.bindreturnsEAFNOSUPPORT.sendtois delivered to the peer.connectreturnsEAFNOSUPPORT, and addressed sends end inEPIPE.sendtoandsendmsgreturnEISCONN, and the pair still exchanges data.bindreturnsEAFNOSUPPORT.shutdown(SHUT_WR), sends with and without an address returnEPIPE, also once the peer is closed.connectreturnsEISCONN, an addressedsendtois delivered, and after the peer closes it returnsEPIPE.Windows 11 Pro, Intel Core i5-14600KF, WinLibs GCC 15.2.0, full Release build:
main'sUdp.cpp):guest_socket_pairaborts.guest_socket_pairpasses with--repeat until-fail:5, and the 156 tests matchingsocket|tcp|udp|kqueue|equeue|guest_net|select|poll|net_|recv|send|shutdown(without theselect_tests_*tests of the test-selection tool) pass with--repeat until-fail:3.ctestonmain474030e58:99% tests passed, 2 tests failed out of 3191. Both fail onmainon this machine too:guest_wide_formatting:%Zgives the host's non-ASCII zone name, which fix(libc): convert Windows time zone names to UTF-8 #10987 addresses.agc_driver_image_plane_address_on_line.check_skips.pyreports one skip,guest_fopen_errors. It skips itself on this machine because creating symbolic links needs Developer Mode.Linux (Ubuntu 24.04 container, GCC 13.3.0): without the fix
guest_socket_pairaborts; with it, it passes with--repeat until-fail:5, and the 117 tests matching the same pattern pass with--repeat until-fail:3. Full Linuxctestwas not run.macOS: not tested. The changed code is shared, and macOS has no sequenced-packet pair.
Overlaps: none. #7090 (
SCM_RIGHTS) and #11896 (MSG_WAITALL) change other parts ofUdp.cpp; #13742 changessocketpair's result-pointer check.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)