-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
freebsd add basic ethernet frames support #4252
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit but this looks good to me. @asomers could you take a look?
2fd85cc
to
b5ff627
Compare
@@ -2541,6 +2553,55 @@ cfg_if! { | |||
.finish() | |||
} | |||
} | |||
|
|||
// FIXME(msrv): `derive` on packed structs cannot be used below 1.67 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds to me like a compelling reason to raise the main branch's MSRV. Why is it currently set to 1.63?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.63 is what Debian stable currently ships so it is a pretty common baseline in the ecosystem. In a few months Trixie will be released 1.83 (or higher) so we will probably be able to do another bump (not that high, but at least above 1.63).
@@ -4957,6 +5028,24 @@ f! { | |||
pub fn PROT_MAX_EXTRACT(x: c_int) -> c_int { | |||
(x >> 16) & (crate::PROT_READ | crate::PROT_WRITE | crate::PROT_EXEC) | |||
} | |||
|
|||
pub {const} fn ETHER_IS_MULTICAST(addr: *mut u_char) -> bool { | |||
(*addr.wrapping_add(0)) & 0x01 != 0x00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised that Clippy doesn't complain about the uselessness of wrapping_add(0)
.
reference