nix
nix copied to clipboard
Add `From<libc::sockaddr_ll> for LinkAddr`
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 https://github.com/nix-rust/nix/issues/2059#issuecomment-1878463448 for reference.
Checklist:
- [x] 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~~
Do you consider the From
implementation a change to the API that should be noted in the changelog?
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 https://github.com/nix-rust/nix/issues/2327#issuecomment-2053587739
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
I filed an alternative PR (#2397) to address the concern of invalid data.