From 3bf64a32fba31218915bb595a8de7c57b41dee27 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 31 Jan 2018 13:46:36 +0000 Subject: [PATCH] Remove length check that is redundant after 181083f1. --- src/wire/ipv4.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wire/ipv4.rs b/src/wire/ipv4.rs index 69f79ea..3d6bc9e 100644 --- a/src/wire/ipv4.rs +++ b/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) }