Skip to content

Commit 938a9a3

Browse files
committed
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
1 parent e06d905 commit 938a9a3

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
@@ -1799,7 +1799,7 @@ fn test_android(target: &str) {
17991799
| "MADV_POPULATE_WRITE" => true,
18001800

18011801
// kernel 5.6 minimum required
1802-
"IPPROTO_MPTCP" => true,
1802+
"IPPROTO_MPTCP" | "IPPROTO_ETHERNET" => true,
18031803

18041804
_ => false,
18051805
}
@@ -3578,6 +3578,7 @@ fn test_linux(target: &str) {
35783578

35793579
// IPPROTO_MAX was increased in 5.6 for IPPROTO_MPTCP:
35803580
| "IPPROTO_MAX"
3581+
| "IPPROTO_ETHERNET"
35813582
| "IPPROTO_MPTCP" => true,
35823583

35833584
// 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
@@ -1041,6 +1041,7 @@ IPPROTO_DSTOPTS
10411041
IPPROTO_EGP
10421042
IPPROTO_ENCAP
10431043
IPPROTO_ESP
1044+
IPPROTO_ETHERNET
10441045
IPPROTO_FRAGMENT
10451046
IPPROTO_GRE
10461047
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)