Drop truncated UDP packets

These would fail decryption anyway, so this saves us some CPU.
This commit is contained in:
Benjamin Saunders
2019-11-16 16:57:19 -08:00
committed by Dirkjan Ochtman
parent 76875b7af5
commit 3f36be64af
+3
View File
@@ -151,6 +151,9 @@ impl super::UdpExt for UdpSocket {
}
return Err(e);
}
if hdr.msg_flags & libc::MSG_TRUNC != 0 {
continue;
}
break n;
};
let name = unsafe { name.assume_init() };