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: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=706fca8a5bab377569046ad1aa7ddfee5b96fa1a;p=openvswitch New function to test for multicast addresses that must not be forwarded. --- diff --git a/lib/packets.h b/lib/packets.h index adda6bdd..7f6bd42f 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