dist/IO: Set io_socket_peername during configure() of a Unix socket#24273
Open
mbanck wants to merge 1 commit intoPerl:bleadfrom
Open
dist/IO: Set io_socket_peername during configure() of a Unix socket#24273mbanck wants to merge 1 commit intoPerl:bleadfrom
mbanck wants to merge 1 commit intoPerl:bleadfrom
Conversation
Some systems (notably GNU/Hurd) do not support getpeername() on a local Unix socket, which breaks read() on them as it tries to set the peer if there is none already. In order to circumvent that, set the peer during configure(), where it is known. Fixes Perl#24195
Leont
reviewed
Mar 14, 2026
| } | ||
| elsif(exists $arg->{Peer}) { | ||
| my $addr = sockaddr_un($arg->{Peer}); | ||
| ${*$sock}{'io_socket_peername'} = $arg->{Peer}; |
Contributor
There was a problem hiding this comment.
This is incorrect, it should be a sockaddr.
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.
Some systems (notably GNU/Hurd) do not support getpeername() on a local Unix socket, which breaks read() on them as it tries to set the peer if there is none already. In order to circumvent that, set the peer during configure(), where it is known.
Fixes #24195
This is an alternative (and probably superior) approach to #24201 . In general, both could be applied, but either works for fixing #24195