According to RFC 1122, unsupported IP options MUST be ignored.
This commit is contained in:
parent
7db21529e5
commit
8876d71802
|
@ -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 managed::{Managed, ManagedSlice};
|
||||||
|
|
||||||
use {Error, Result};
|
use {Error, Result};
|
||||||
|
|
|
@ -403,8 +403,6 @@ impl Repr {
|
||||||
if packet.version() != 4 { return Err(Error::Malformed) }
|
if packet.version() != 4 { return Err(Error::Malformed) }
|
||||||
// Valid checksum is expected.
|
// Valid checksum is expected.
|
||||||
if !packet.verify_checksum() { return Err(Error::Checksum) }
|
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.
|
// We do not support fragmentation.
|
||||||
if packet.more_frags() || packet.frag_offset() != 0 { return Err(Error::Fragmented) }
|
if packet.more_frags() || packet.frag_offset() != 0 { return Err(Error::Fragmented) }
|
||||||
// Total length may not be less than header length.
|
// Total length may not be less than header length.
|
||||||
|
|
Loading…
Reference in New Issue