Skip to content

Commit c16d97c

Browse files
committed
Auto merge of #3272 - sunfishcode:sunfishcode/ethernet, r=JohnTitor
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.
2 parents 8530e6f + 938a9a3 commit c16d97c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,7 @@ fn test_android(target: &str) {
18001800
| "MADV_POPULATE_WRITE" => true,
18011801

18021802
// kernel 5.6 minimum required
1803-
"IPPROTO_MPTCP" => true,
1803+
"IPPROTO_MPTCP" | "IPPROTO_ETHERNET" => true,
18041804

18051805
_ => false,
18061806
}
@@ -3597,6 +3597,7 @@ fn test_linux(target: &str) {
35973597

35983598
// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
35993599
| "IPPROTO_MAX"
3600+
| "IPPROTO_ETHERNET"
36003601
| "IPPROTO_MPTCP" => true,
36013602

36023603
// FIXME: Not currently available in headers

libc-test/semver/linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ IPPROTO_DSTOPTS
10551055
IPPROTO_EGP
10561056
IPPROTO_ENCAP
10571057
IPPROTO_ESP
1058+
IPPROTO_ETHERNET
10581059
IPPROTO_FRAGMENT
10591060
IPPROTO_GRE
10601061
IPPROTO_HOPOPTS

src/unix/linux_like/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,8 @@ pub const IPPROTO_BEETPH: ::c_int = 94;
918918
pub const IPPROTO_MPLS: ::c_int = 137;
919919
/// Multipath TCP
920920
pub const IPPROTO_MPTCP: ::c_int = 262;
921+
/// Ethernet-within-IPv6 encapsulation.
922+
pub const IPPROTO_ETHERNET: ::c_int = 143;
921923

922924
pub const MCAST_EXCLUDE: ::c_int = 0;
923925
pub const MCAST_INCLUDE: ::c_int = 1;

0 commit comments

Comments
 (0)