From: Ben Pfaff Date: Tue, 31 Mar 2009 21:46:27 +0000 (-0700) Subject: Be more liberal about what constitutes a virtual interface MAC on Xen. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf4108e0d43c16302d1def8868943ea6482cb92b;p=openvswitch Be more liberal about what constitutes a virtual interface MAC on Xen. The xapi sources indicate that FE:FE:FE:FE:FE:FE can sometimes be used for virtual interfaces, in addition to the usual FE:FF:FF:FF:FF:FF, so accept that (and other similar variants) as well. --- diff --git a/lib/packets.h b/lib/packets.h index 9c7ee9ce..2d1e6d49 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -44,18 +44,19 @@ static const uint8_t eth_addr_broadcast[ETH_ADDR_LEN] UNUSED = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -/* This is the Ethernet address used by virtual interfaces under Xen. */ -static const uint8_t eth_addr_vif[ETH_ADDR_LEN] UNUSED - = { 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff }; - static inline bool eth_addr_is_broadcast(const uint8_t ea[6]) { return (ea[0] & ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) == 0xff; } + +/* Returns true if 'ea' is an Ethernet address used for virtual interfaces + * under XenServer. Generally the actual Ethernet address is FE:FF:FF:FF:FF:FF + * but it can be FE:FE:FE:FE:FE:FE in some cases. */ static inline bool eth_addr_is_vif(const uint8_t ea[6]) { - return ea[0] == 0xfe && (ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) == 0xff; + return ea[0] == 0xfe && (ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) >= 0xfe; } + static inline bool eth_addr_is_multicast(const uint8_t ea[6]) { return ea[0] & 1;