Skip to content

Commit

Permalink
Suppress af_alg_iv "deprecation"
Browse files Browse the repository at this point in the history
See rust-lang/libc#1501 in which this type's
trait implementations are being removed; the change is being announced
via this deprecation.
  • Loading branch information
tamird committed Nov 15, 2020
1 parent 5d2a8c2 commit 328530f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 328530f

Please sign in to comment.