net_util: add safety comments for impl ByteValued

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2021-11-17 13:28:57 +00:00 committed by Rob Bradford
parent 6f49cb2860
commit 8ee253cd3f
2 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@ pub struct ControlHeader {
pub cmd: u8,
}
// SAFETY: ControlHeader only contains a series of integers
unsafe impl ByteValued for ControlHeader {}
pub struct CtrlQueue {

View File

@ -59,7 +59,7 @@ pub struct VirtioNetConfig {
pub duplex: u8,
}
// Safe because it only has data and has no implicit padding.
// SAFETY: it only has data and has no implicit padding.
unsafe impl ByteValued for VirtioNetConfig {}
/// Create a sockaddr_in from an IPv4 address, and expose it as