Skip to content

Commit

Permalink
Auto merge of #3272 - sunfishcode:sunfishcode/ethernet, r=JohnTitor
Browse files Browse the repository at this point in the history
Define `IPPROTO_ETHERNET` on Linux-like platforms.

Define the `IPPROTO_ETHERNET` constant on Linux-like platforms.

This value is also now a registered protocol number IANA, called "Ethernet":

https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

I haven't run all the CI tests locally because my kernel is new too and I hit #3160.
  • Loading branch information
bors committed Jun 24, 2023
2 parents 8530e6f + 938a9a3 commit c16d97c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libc-test/build.rs
Expand Up @@ -1800,7 +1800,7 @@ fn test_android(target: &str) {
| "MADV_POPULATE_WRITE" => true,

// kernel 5.6 minimum required
"IPPROTO_MPTCP" => true,
"IPPROTO_MPTCP" | "IPPROTO_ETHERNET" => true,

_ => false,
}
Expand Down Expand Up @@ -3597,6 +3597,7 @@ fn test_linux(target: &str) {

// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
| "IPPROTO_MAX"
| "IPPROTO_ETHERNET"
| "IPPROTO_MPTCP" => true,

// FIXME: Not currently available in headers
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -1055,6 +1055,7 @@ IPPROTO_DSTOPTS
IPPROTO_EGP
IPPROTO_ENCAP
IPPROTO_ESP
IPPROTO_ETHERNET
IPPROTO_FRAGMENT
IPPROTO_GRE
IPPROTO_HOPOPTS
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/mod.rs
Expand Up @@ -918,6 +918,8 @@ pub const IPPROTO_BEETPH: ::c_int = 94;
pub const IPPROTO_MPLS: ::c_int = 137;
/// Multipath TCP
pub const IPPROTO_MPTCP: ::c_int = 262;
/// Ethernet-within-IPv6 encapsulation.
pub const IPPROTO_ETHERNET: ::c_int = 143;

pub const MCAST_EXCLUDE: ::c_int = 0;
pub const MCAST_INCLUDE: ::c_int = 1;
Expand Down

0 comments on commit c16d97c

Please sign in to comment.