Follow-up to b9e79d19; always process broadcast frames.
This commit is contained in:
parent
d25eebc0ef
commit
5137608aed
|
@ -119,7 +119,10 @@ 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(()) }
|
||||
if !eth_frame.dst_addr().is_broadcast() &&
|
||||
eth_frame.dst_addr() != self.hardware_addr {
|
||||
return Ok(())
|
||||
}
|
||||
|
||||
let mut response = Response::Nop;
|
||||
match eth_frame.ethertype() {
|
||||
|
|
|
@ -45,6 +45,11 @@ impl Address {
|
|||
&self.0
|
||||
}
|
||||
|
||||
/// Query whether this address is the broadcast address.
|
||||
pub fn is_broadcast(&self) -> bool {
|
||||
self.0 == [0xff; 6]
|
||||
}
|
||||
|
||||
/// Query whether the "multicast" bit in the OUI is set.
|
||||
pub fn is_multicast(&self) -> bool {
|
||||
self.0[0] & 0x01 != 0
|
||||
|
|
Loading…
Reference in New Issue