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

Add From<libc::sockaddr_ll> for LinkAddr #2396

Closed

Conversation

jonatanzeidler
Copy link

What does this PR do

This PR adds a impl From<libc::sockaddr_ll> for LinkAddr to help users of nix avoid unsafe code. See #2059 (comment) for reference.

Checklist:

  • I have read CONTRIBUTING.md
  • [ ] I have written necessary tests and rustdoc comments
  • [ ] A change log has been added if this PR modifies nix's API

@jonatanzeidler
Copy link
Author

Do you consider the From implementation a change to the API that should be noted in the changelog?

@SteveLauC
Copy link
Member

My current concert of this kind of conversion is that it can be unsafe since we have no guarantee from the values set in those raw libc types, see #2327 (comment)

Do you consider the From implementation a change to the API that should be noted in the changelog?

No since they are newly-added things

@jonatanzeidler
Copy link
Author

I filed an alternative PR (#2397) to address the concern of invalid data.

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.

2 participants