diff options
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/kernel/net/netlink.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/kernel/net/netlink.rs b/rust/kernel/net/netlink.rs index 2f8733a694a9..36f2e39c3ab7 100644 --- a/rust/kernel/net/netlink.rs +++ b/rust/kernel/net/netlink.rs @@ -13,7 +13,6 @@ use kernel::{ error::to_result, num::casts::u16_as_usize, prelude::*, - transmute::AsBytes, types::Opaque, ThisModule, }; @@ -23,6 +22,11 @@ use core::{ ptr::NonNull, // }; +use zerocopy::{ + Immutable, + IntoBytes, // +}; + /// The default netlink message size. pub const GENLMSG_DEFAULT_SIZE: usize = bindings::GENLMSG_DEFAULT_SIZE; @@ -85,7 +89,7 @@ impl GenlMsg { #[inline] fn put<T>(&mut self, attrtype: c_int, value: &T) -> Result where - T: ?Sized + AsBytes, + T: ?Sized + IntoBytes + Immutable, { // `nla_len` is a 16-bit field that encodes the total attribute length // (header + payload). Subtracting the header size from `u16::MAX` gives |
