From: Ben Pfaff Date: Mon, 5 Jan 2009 23:59:40 +0000 (-0800) Subject: New function to test for multicast addresses that must not be forwarded. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8e8ac8082560dee6051fbe899bc0596025623b51;p=sliver-openvswitch.git New function to test for multicast addresses that must not be forwarded. --- diff --git a/lib/packets.h b/lib/packets.h index adda6bdd6..7f6bd42f6 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -89,6 +89,17 @@ static inline void eth_addr_random(uint8_t ea[ETH_ADDR_LEN]) ea[0] &= ~1; /* Unicast. */ ea[0] |= 2; /* Private. */ } +/* Returns true if 'ea' is a reserved multicast address, that a bridge must + * never forward, false otherwise. */ +static inline bool eth_addr_is_reserved(const uint8_t ea[ETH_ADDR_LEN]) +{ + return (ea[0] == 0x01 + && ea[1] == 0x80 + && ea[2] == 0xc2 + && ea[3] == 0x00 + && ea[4] == 0x00 + && (ea[5] & 0xf0) == 0x00); +} #define ETH_ADDR_FMT \ "%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8":%02"PRIx8