Skip to content

Commit 1040d97

Browse files
committed
Add ETH_P_ALL protocol number to SockProtocol
Add note to Changelog.md Make changes in comments Co-authored-by: Alan Somers <asomers@gmail.com> Add Android as target os for ETH_P_ALL
1 parent 7cc33c1 commit 1040d97

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66
## [Unreleased] - ReleaseDate
77
### Added
88

9+
- Added ETH_P_ALL to SockProtocol enum
10+
(#[1768](https://github.com/nix-rust/nix/pull/1768))
911
- Added four non-standard Linux `SysconfVar` variants
1012
(#[1761](https://github.com/nix-rust/nix/pull/1761))
1113
- Added const constructors for `TimeSpec` and `TimeVal`

src/sys/socket/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ pub enum SockProtocol {
214214
#[cfg(any(target_os = "android", target_os = "linux"))]
215215
#[cfg_attr(docsrs, doc(cfg(all())))]
216216
NetlinkCrypto = libc::NETLINK_CRYPTO,
217+
/// Non-DIX type protocol number defined for the Ethernet IEEE 802.3 interface that allows packets of all protocols
218+
/// defined in the interface to be received.
219+
/// ([ref](https://man7.org/linux/man-pages/man7/packet.7.html))
220+
// The protocol number is fed into the socket syscall in network byte order.
221+
#[cfg(any(target_os = "android", target_os = "linux"))]
222+
#[cfg_attr(docsrs, doc(cfg(all())))]
223+
EthAll = libc::ETH_P_ALL.to_be(),
217224
}
218225

219226
#[cfg(any(target_os = "linux"))]

0 commit comments

Comments
 (0)