Skip to content
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

For invalid IP address conversions with future Rust versions #2061

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

asomers
Copy link
Member

@asomers asomers commented Jun 27, 2023

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of). So do the conversions explicitly instead of transmuting.

Fixes #2053

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr
are wrappers around the C types (though for now at least, they are
identical on all platforms I'm aware of).  So do the conversions
explicitly instead of transmuting.

Fixes nix-rust#2053
@asomers asomers force-pushed the ipv4addr_to_libc branch from 694ed59 to 1546857 Compare June 28, 2023 03:26
@asomers
Copy link
Member Author

asomers commented Jun 29, 2023

bors r+

@bors bors bot merged commit 728609c into nix-rust:master Jun 29, 2023
asomers added a commit to asomers/nix that referenced this pull request Aug 27, 2023
2061: For invalid IP address conversions with future Rust versions r=asomers a=asomers

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of).  So do the conversions explicitly instead of transmuting.

Fixes nix-rust#2053

Co-authored-by: Alan Somers <[email protected]>
asomers added a commit to asomers/nix that referenced this pull request Aug 27, 2023
2061: For invalid IP address conversions with future Rust versions r=asomers a=asomers

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of).  So do the conversions explicitly instead of transmuting.

Fixes nix-rust#2053

Co-authored-by: Alan Somers <[email protected]>
asomers added a commit to asomers/nix that referenced this pull request Aug 27, 2023
2061: For invalid IP address conversions with future Rust versions r=asomers a=asomers

Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of).  So do the conversions explicitly instead of transmuting.

Fixes nix-rust#2053

Co-authored-by: Alan Somers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid transmute from std::net::Ipv4Addr to libc::in_addr
1 participant