Repository navigation
Conversation
…tion is dissolved udp_disconnect resets the local address to INADDR_ANY and keeps the port. Dissolving the association with connect to AF_UNSPEC left the host socket's local address in place, so getsockname still returned 127.0.0.1 on Windows. The socket remembers that its association was dissolved and getsockname reports the wildcard address until the next bind or connect. guest_udp now checks that on Windows too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
The stored flag and getsockname adjustment cover both AF_INET and AF_INET6, and the description says the wildcard address is reported for both families. The new regression only exercises an IPv4 socket, so the IPv6 branch currently has no coverage (the description also notes it was not tested). Could you add an IPv6 case where the host supports it, checking the address becomes :: while the bound port is preserved after connect(AF_UNSPEC)?
|
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.
|
… is dissolved Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks @MarcZX10: added the IPv6 case in f6d8cca. After AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
The current head f6d8cca311 records the cleared local-address state for both IPv4 and IPv6, then reports the wildcard address while preserving the host-assigned port. The new IPv6 regression checks the port and ::, and the author reports Windows failure when only the IPv6 fix is removed and a pass with it. Hosted build/runtime jobs are path-skipped, so I am relying on the reported Windows run; Linux/macOS remain untested. I also left a note about the CMake-style merge-order concern in the UDP implementation: #8344 adds an independent Socket::peer member in the same struct and should be included in the overlap notes.
|
One overlap entry appears to be missing from the PR description: the overlap bot flags #8344 on |
|
@xXPBSXx Thanks. The FreeBSD reference ( One concern. When the port is non-zero, Two options. (1) Actually move the host socket to the wildcard address: for example, create a new host UDP socket, bind it to wildcard:port, copy the stored options, and swap it in under the socket's lock. (2) If a title needs only the |
|
@oneandonlydean you are right, and I measured it before answering. Probe (plain Winsock, Windows 10 Pro 19045, WinLibs GCC 15.2.0): an UDP socket
So the masking only changes the answer for the explicitly bound case, and there it reports a state the host does not have: exactly the failure mode you describe. (The implicit case already reports the wildcard address on Which title reads the local address after dissolving the association? I do not know of one. I found this by comparing against Option 1 is not something I want to land blind. The host handle in Proposal: I close this PR rather than leave a reported state without a host counterpart. If you prefer to keep a record, I can open a docs-only PR that adds the divergence to the libkernel debt file (after AI-assisted (Claude Code). |
|
Two corrections to my reply above:
AI-assisted (Claude Code). |
|
@xXPBSXx Thanks for measuring it. The table settles it: the masking changes the answer only for the explicitly bound socket, and there the host is still on 127.0.0.1. For an implicitly bound socket, So yes, please close this one, and the docs-only PR is welcome. Put it in We don't want option 1 without a title: replaying every stored option and swapping the handle under concurrent |
|
Closing as agreed with @oneandonlydean above: the PR makes A docs-only PR is welcome: add to |
What
udp_disconnectresets the local address toINADDR_ANYand keeps the port. Dissolving the association withconnecttoAF_UNSPECleft the host socket's local address in place, sogetsocknamestill returned127.0.0.1(Windows; Linux for a socket bound to an explicit port). The socket now remembers that its association was dissolved andgetsocknamereports the wildcard address (IPv4 and IPv6) until the nextbindorconnect. The host socket itself is unchanged; the Technical debt entry forconnecttoAF_UNSPECsays so.guest_udpruns the check on Windows now.Fixes #8681
Overlap:
git merge-treehas conflicts with #8499 (two), #8448 (one) and #7511 (one) inUdp.cpp; the other open socket PRs (#8670, #8492, #8483, #8474, #8463, #7850, #7090) are clean. Whichever lands second rebases.pr_overlapwas not run.Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on current upstream/main + this commit:
guest_udpfails without the change toUdp.cppand passes with it; 10 other socket tests pass.python tools/check_conventions.py --base upstream/main: passes. Not tested: Linux/macOS, the IPv6 path, a console.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Overlap note: #8344 adds independent
Socket::peertracking (socketpairgetpeername) inUdp.cpp; this PR addsSocket::localAddressCleared. No behavior duplicate, but theSocketmember hunks must be kept together if both land.