Browse Source

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

whitequark 7 years ago
parent
commit
6ebcddd077
2 changed files with 3 additions and 2 deletions
  1. 3 0
      src/iface/ethernet.rs
  2. 0 2
      src/wire/ipv4.rs

+ 3 - 0
src/iface/ethernet.rs

@@ -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};

+ 0 - 2
src/wire/ipv4.rs

@@ -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.