fn init_vnet_hdr(buf: &mut [u8]) {
    // The buffer should be larger than vnet_hdr_len.
    // TODO: any better way to set all these bytes to 0? Or is this optimized by the compiler?
    for i in &mut buf[0..vnet_hdr_len()] {
        *i = 0;
    }
}
// This initializes to all 0 the VNET hdr part of a buf.
This initializes to all 0 the VNET hdr part of a buf.
This initializes to all 0 the VNET hdr part of a buf .
fn init_vnet_hdr(buf: &mut [u8]) {
    // The buffer should be larger than vnet_hdr_len.
    // TODO: any better way to set all these bytes to 0? Or is this optimized by the compiler?
    for i in &mut buf[0..vnet_hdr_len()] {
        *i = 0;
    }
}
fn init_vnet_hdr ( buf : & mut [ u8 ] ) { // The buffer should be larger than vnet_hdr_len. // TODO: any better way to set all these bytes to 0? Or is this optimized by the compiler? for i in & mut buf [ 0 .. vnet_hdr_len ( ) ] { * i = 0 ; } }
This initializes to all 0 the VNET hdr part of a buf.
This initializes to all 0 the VNET hdr part of a buf .
buf
&mut [u8]
buf
&mut [u8]