Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dump malformed ingress packets at DEBUG log level.
Browse files Browse the repository at this point in the history
whitequark committed Oct 24, 2017
1 parent 8ee2f7b commit a3a6565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iface/ethernet.rs
Original file line number Diff line number Diff line change
@@ -175,6 +175,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
Ok(response) => response,
Err(err) => {
net_debug!("cannot process ingress packet: {}", err);
net_debug!("packet dump follows:\n{}");
return Err(err)
}
};
@@ -274,7 +275,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
&source_hardware_addr);
} else {
// Discard packets with non-unicast source addresses.
net_debug!("non-unicast source in {}", arp_repr);
net_debug!("non-unicast source address");
return Err(Error::Malformed)
}

@@ -305,7 +306,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {

if !ipv4_repr.src_addr.is_unicast() {
// Discard packets with non-unicast source addresses.
net_debug!("non-unicast source in {}", ipv4_repr);
net_debug!("non-unicast source address");
return Err(Error::Malformed)
}

0 comments on commit a3a6565

Please sign in to comment.