Ethernet multicast support at nic_bridge

Fix #3282
This commit is contained in:
Ehmry - 2019-04-11 21:33:57 +02:00 committed by Christian Helmuth
parent 3460444d84
commit 4caffd79db
2 changed files with 13 additions and 3 deletions

View File

@ -17,6 +17,12 @@
/* OS includes */
#include <net/netaddress.h>
namespace Net { using Mac_address = Net::Network_address<6, ':', true>; }
namespace Net { struct Mac_address; }
struct Net::Mac_address : Net::Network_address<6, ':', true>
{
using Net::Network_address<6, ':', true>::Network_address;
bool multicast() const { return addr[0] & 1; }
};
#endif /* _NET__MAC_ADDRESS_H_ */

View File

@ -61,8 +61,12 @@ void Packet_handler::_link_state()
void Packet_handler::broadcast_to_clients(Ethernet_frame *eth, Genode::size_t size)
{
/* check whether it's really a broadcast packet */
if (eth->dst() == Ethernet_frame::broadcast()) {
/*
* For simplicity reasons, we broadcast all multicast packets not only the
* special multicast case "broadcast". (The broadcast address also has the
* multicast bit set on Ethernet).
*/
if (eth->dst().multicast()) {
/* iterate through the list of clients */
Mac_address_node *node =
_vlan.mac_list.first();