summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2020-11-09 16:51:00 -0500
committerTamir Duberstein <tamird@google.com>2020-11-15 12:56:34 -0500
commit328530fa814767c26077406eb707e46437755f54 (patch)
tree3abdf349cde93afa0cd7af314ee462e2152270cf /src/sys
parent5d2a8c221af121abe73e313bdfce8ae2f4372a83 (diff)
downloadnix-328530fa814767c26077406eb707e46437755f54.zip
Suppress af_alg_iv "deprecation"
See https://github.com/rust-lang/libc/issues/1501 in which this type's trait implementations are being removed; the change is being announced via this deprecation.
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/socket/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 5e5fb8d3..3bb96074 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -847,12 +847,13 @@ impl<'a> ControlMessage<'a> {
}
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetIv(iv) => {
+ #[allow(deprecated)] // https://github.com/rust-lang/libc/issues/1501
let af_alg_iv = libc::af_alg_iv {
ivlen: iv.len() as u32,
iv: [0u8; 0],
};
- let size = mem::size_of::<libc::af_alg_iv>();
+ let size = mem::size_of_val(&af_alg_iv);
unsafe {
ptr::copy_nonoverlapping(
@@ -915,7 +916,7 @@ impl<'a> ControlMessage<'a> {
}
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetIv(iv) => {
- mem::size_of::<libc::af_alg_iv>() + iv.len()
+ mem::size_of_val(&iv) + iv.len()
},
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetOp(op) => {