Ignore Ethernet frames for which we aren't a destination.

This commit is contained in:
whitequark 2017-03-06 03:58:19 +00:00
parent c9a2ac7a40
commit d25eebc0ef
1 changed files with 2 additions and 0 deletions

View File

@ -119,6 +119,8 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
let rx_buffer = try!(self.device.receive());
let eth_frame = try!(EthernetFrame::new(&rx_buffer));
if eth_frame.dst_addr() != self.hardware_addr { return Ok(()) }
let mut response = Response::Nop;
match eth_frame.ethertype() {
// Snoop all ARP traffic, and respond to ARP packets directed at us.