From ca7e54b8d12401d696372af03ccb4525bc5541ab Mon Sep 17 00:00:00 2001 From: Frank Pagliughi Date: Sat, 10 Dec 2022 16:43:22 -0500 Subject: [PATCH] Update src/sys/socket/mod.rs Co-authored-by: Alan Somers --- src/sys/socket/mod.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index a668919666..1ba97e0ad2 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -234,13 +234,14 @@ pub enum SockProtocol { CanRaw = libc::CAN_RAW, } -/// The Controller Area Network broadcast manager protocol -/// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan)) -#[cfg(target_os = "linux")] -#[cfg_attr(docsrs, doc(cfg(all())))] -#[allow(non_upper_case_globals)] -pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock; // Matches libc::CAN_BCM - +impl SockProtocol { + /// The Controller Area Network broadcast manager protocol + /// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan)) + #[cfg(target_os = "linux")] + #[cfg_attr(docsrs, doc(cfg(all())))] + #[allow(non_upper_case_globals)] + pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock; // Matches libc::CAN_BCM +} #[cfg(any(target_os = "linux"))] libc_bitflags! { /// Configuration flags for `SO_TIMESTAMPING` interface