Browse Source

Remove length check that is redundant after 181083f1.

whitequark 7 years ago
parent
commit
1d2ec8c135
1 changed files with 0 additions and 2 deletions
  1. 0 2
      src/wire/ipv4.rs

+ 0 - 2
src/wire/ipv4.rs

@@ -483,8 +483,6 @@ impl Repr {
         if checksum_caps.ipv4.rx() && !packet.verify_checksum() { return Err(Error::Checksum) }
         // We do not support fragmentation.
         if packet.more_frags() || packet.frag_offset() != 0 { return Err(Error::Fragmented) }
-        // Total length may not be less than header length.
-        if packet.total_len() < packet.header_len() as u16 { return Err(Error::Malformed) }
         // Since the packet is not fragmented, it must include the entire payload.
         let payload_len = packet.total_len() as usize - packet.header_len() as usize;
         if packet.payload().len() < payload_len  { return Err(Error::Truncated) }