-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the Sockaddr enum with a union #1684
Merged
Merged
Conversation
This file contains 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
asomers
force-pushed
the
sockaddr_union3
branch
from
March 20, 2022 17:43
ce8090f
to
fccc970
Compare
rtzoeller
approved these changes
Mar 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall.
I ran the tests locally on DragonFlyBSD as well with no issues.
@asomers I think this just needs to be squashed; I'm happy with the changes. |
The SockAddr enum is quite large, and the user must allocate space for the whole thing even though he usually knows what type he needs. Furthermore, thanks to the sa_family field, the sockaddr types are basically an enum even in C. So replace the ungainly enum with a SockaddrLike trait implemented by all sockaddr types and a SockaddrStorage union that has safe accessors. Also, deprecate InetAddr, which only existed to support SockAddr. Supplants nix-rust#1504 Fixes nix-rust#1544
asomers
force-pushed
the
sockaddr_union3
branch
from
March 22, 2022 02:51
511c25e
to
76d70b4
Compare
bors r=rtzoeller |
This was referenced Mar 24, 2022
asomers
added a commit
to asomers/nix
that referenced
this pull request
May 31, 2022
This was an oversight from nix-rust#1684. Fixes nix-rust#1728
asomers
added a commit
to asomers/nix
that referenced
this pull request
May 31, 2022
This was an oversight from nix-rust#1684. Fixes nix-rust#1728
rtzoeller
pushed a commit
to rtzoeller/nix
that referenced
this pull request
Jul 17, 2022
This was an oversight from nix-rust#1684. Fixes nix-rust#1728
3 tasks
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.
The SockAddr enum is quite large, and the user must allocate space for
the whole thing even though he usually knows what type he needs.
Furthermore, thanks to the sa_family field, the sockaddr types are
basically an enum even in C.
So replace the ungainly enum with a SockaddrLike trait implemented by
all sockaddr types and a SockaddrStorage union that has safe accessors.
Also, deprecate InetAddr, which only existed to support SockAddr.
Supplants #1504
Fixes #1544