Browse Source

properly set the size in no_flag packets

pull/3/head
jake 5 years ago
parent
commit
5324ab1188
  1. 2
      psopacket/src/lib.rs

2
psopacket/src/lib.rs

@ -177,7 +177,7 @@ fn generate_psopacket_impl(pkt_cmd: u16, name: syn::Ident, attrs: &Vec<AttrType>
buf.push(0);
}
let pkt_len = (buf.len() + 8) as u16;
let pkt_len = (buf.len() + if #include_flag { 8 } else { 4 }) as u16;
let mut prebuf: Vec<u8> = Vec::new();
prebuf.extend_from_slice(&u16::to_le_bytes(pkt_len));

Loading…
Cancel
Save