Skip to content

nl_pad is private and is required to be initialized for sockaddr_nl #1135

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
WillYu91 opened this issue Nov 22, 2018 · 3 comments
Closed

nl_pad is private and is required to be initialized for sockaddr_nl #1135

WillYu91 opened this issue Nov 22, 2018 · 3 comments

Comments

@WillYu91
Copy link

WillYu91 commented Nov 22, 2018

nl_pad: ::c_ushort,

I was able to fix this buy marking nl_pad as pub

@gnzlbg
Copy link
Contributor

gnzlbg commented Nov 22, 2018

PR welcome :)

@gnzlbg
Copy link
Contributor

gnzlbg commented Jan 21, 2019

FWIW you don't need to access nl_pad to initialize the struct, e.g., you can use MaybeUninit<sockaddr_nl>::zeroed() to zero the struct, and then only initialize the relevant fields.

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 7, 2019

Alternatively, you can use let x: sockaddr_nl = unsafe { mem::zeroed() }; on stable Rust, although if you can use nightly MaybeUninit is preferable.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants