Browse Source

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

whitequark 8 years ago
parent
commit
b9e79d19a7
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/iface/ethernet.rs

+ 2 - 0
src/iface/ethernet.rs

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