Repository navigation
Write Unix socket addresses in refcount getsockname - #584
Open
perfloop-agent wants to merge 2 commits into
Open
perfloop-agent wants to merge 2 commits into
perfloop-agent wants to merge 2 commits into
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai> Signed-off-by: Tomás Senart <ts@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai> Signed-off-by: Tomás Senart <ts@perfloop.ai>
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.
Summary
Refcount
getsocknamenow writes the family and address bytes for Unix sockets instead of returning success with an unchanged output buffer. The Unix branch of the shared encoder copies no more than the caller's capacity or the actual address length, leaves the suffix untouched, and reports the full length.getpeernameandrecvfrominherit the same Unix writeback.tests/unit/socket_unix_name.c checks unnamed and pathname-bound sockets, shortened buffers, returned lengths and protected suffixes. It uses
sockaddr_storagebuffers and the platform's returned length rather than assuming an unnamed length or asockaddr_unsize. The new refcount fixture fails against the unchanged runtime at the missing-family assertion.Addresses that nix cannot represent as
UnixAddrretain the existing fallback. IP output length and capacity handling, and Unix input decoding, are unchanged. Native-byte comparison is Linux-scoped.Testing
The lit runner reports 1,058 passed, 14 expected failures, and 0 failures in
tests/unitfor each Linux Release and Debug build; the Release runs report 76 passed intests/uband 20 passed intests/multi-file, with no failures or skips.On the base revision with only the new test files added,
tests/unitreports 1,057 passed, 14 expected failures, and 1 failure:socket_unix_name.c/refcount, at the missing-family assertion.check-libcc2rspasses 70 unit tests, with 0 failures or ignored tests and 0 doctests.check-libcc2rs-macrospasses 1 compile-fail test and 22 control-flow tests, with 0 failures or ignored tests and 0 doctests.ninja formatcompleted without changing any files.macOS validation remains target-CI-owned.
Case and evidence
Made by Perfloop. Human sponsor: Tomás Senart. To ask for a change, comment or review in plain words. How Perfloop handles pull requests.