diff --git a/net_util/src/ctrl_queue.rs b/net_util/src/ctrl_queue.rs index 56c86154c..41161c6bf 100644 --- a/net_util/src/ctrl_queue.rs +++ b/net_util/src/ctrl_queue.rs @@ -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 { diff --git a/net_util/src/lib.rs b/net_util/src/lib.rs index 434174727..476c6575c 100644 --- a/net_util/src/lib.rs +++ b/net_util/src/lib.rs @@ -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