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

Expose SockAddr::from_raw_sockaddr #1447

Merged
merged 1 commit into from Aug 22, 2021

Conversation

coolreader18
Copy link
Contributor

I also noticed the SockAddr/InetAddr::to_str functions were entirely redundant - ToString exists for that, & has a blanket impl on T: Display.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please split these two changes up, since they're unrelated? Also, it would be good to deprecate to_str for a few releases before removing it entirely.

@coolreader18
Copy link
Contributor Author

@asomers Could you take a look at this again? I split out the other change into #1495 as well.

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot added a commit that referenced this pull request Aug 21, 2021
1447: Expose SockAddr::from_raw_sockaddr r=asomers a=coolreader18

I also noticed the `SockAddr/InetAddr::to_str` functions were entirely redundant - `ToString` exists for that, & has a blanket impl on `T: Display`.


Co-authored-by: Noah <33094578+coolreader18@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Aug 21, 2021

Build failed:

@coolreader18
Copy link
Contributor Author

Huh. I think the failure was just cause of the conflict in CHANGELOG?

@asomers
Copy link
Member

asomers commented Aug 22, 2021

bors retry

@bors bors bot merged commit 28f547f into nix-rust:master Aug 22, 2021
@coolreader18 coolreader18 deleted the sockaddr-from-raw branch August 22, 2021 01:22
@coolreader18
Copy link
Contributor Author

coolreader18 commented Aug 22, 2021

Ah, shoot, just realized the functionality I was looking for was in sockaddr_storage_to_addr - however, I'm pretty sure that should also be unsafe and take a *const sockaddr instead of an &sockaddr_storage, since it seems like there are some assume_init calls that might not be valid as the full extent of the sockaddr_storage might not actually get initialized if the address is only a couple bytes in size. Would that be a reasonable change to make?

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.

None yet

2 participants