According to RFC 1122, unsupported IP options MUST be ignored.

This commit is contained in:
whitequark 2017-09-01 19:31:09 +00:00
parent 7db21529e5
commit 8876d71802
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,6 @@
// Heads up! Before working on this file you should read the parts
// of RFC 1122 that discuss Ethernet, ARP and IP.
use managed::{Managed, ManagedSlice};
use {Error, Result};

View File

@ -403,8 +403,6 @@ impl Repr {
if packet.version() != 4 { return Err(Error::Malformed) }
// Valid checksum is expected.
if !packet.verify_checksum() { return Err(Error::Checksum) }
// We do not support any IP options.
if packet.header_len() > 20 { return Err(Error::Unrecognized) }
// 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.