Skip to content

Commit

Permalink
Ignore unrecognized NDISC options (as per RFC 4861).
Browse files Browse the repository at this point in the history
Closes: #210
Approved by: whitequark
  • Loading branch information
progval authored and Homu committed May 14, 2018
1 parent 4bf917c commit ca079bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/wire/ndisc.rs
Expand Up @@ -228,7 +228,7 @@ impl<'a> Repr<'a> {
let opt = NdiscOption::new_checked(packet.payload())?;
match opt.option_type() {
NdiscOptionType::SourceLinkLayerAddr => Some(opt.link_layer_addr()),
_ => { return Err(Error::Unrecognized); }
_ => ()
}
} else {
None
Expand All @@ -245,7 +245,7 @@ impl<'a> Repr<'a> {
NdiscOptionRepr::SourceLinkLayerAddr(addr) => lladdr = Some(addr),
NdiscOptionRepr::Mtu(val) => mtu = Some(val),
NdiscOptionRepr::PrefixInformation(info) => prefix_info = Some(info),
_ => { return Err(Error::Unrecognized); }
_ => ()
}
offset += opt.buffer_len();
}
Expand All @@ -263,7 +263,7 @@ impl<'a> Repr<'a> {
let opt = NdiscOption::new_checked(packet.payload())?;
match opt.option_type() {
NdiscOptionType::SourceLinkLayerAddr => Some(opt.link_layer_addr()),
_ => { return Err(Error::Unrecognized); }
_ => ()
}
} else {
None
Expand All @@ -277,7 +277,7 @@ impl<'a> Repr<'a> {
let opt = NdiscOption::new_checked(packet.payload())?;
match opt.option_type() {
NdiscOptionType::TargetLinkLayerAddr => Some(opt.link_layer_addr()),
_ => { return Err(Error::Unrecognized); }
_ => ()
}
} else {
None
Expand Down Expand Up @@ -311,7 +311,7 @@ impl<'a> Repr<'a> {
offset += 8 + ip_repr.buffer_len() + data.len();
}
}
_ => { return Err(Error::Unrecognized); }
_ => ()
}
}
Ok(Repr::Redirect {
Expand Down

0 comments on commit ca079bf

Please sign in to comment.