From: Ben Pfaff Date: Mon, 6 Oct 2008 16:37:42 +0000 (-0700) Subject: Random Ethernet addresses should be private and should not be multicast. X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=82b05cb81e54503bc725df3a6eab06858c3db0be;p=sliver-openvswitch.git Random Ethernet addresses should be private and should not be multicast. --- diff --git a/include/packets.h b/include/packets.h index e7681ad43..bad36712d 100644 --- a/include/packets.h +++ b/include/packets.h @@ -86,6 +86,8 @@ static inline void eth_addr_from_uint64(uint64_t x, uint8_t ea[ETH_ADDR_LEN]) static inline void eth_addr_random(uint8_t ea[ETH_ADDR_LEN]) { random_bytes(ea, ETH_ADDR_LEN); + ea[0] &= ~1; /* Unicast. */ + ea[0] |= 2; /* Private. */ } #define ETH_ADDR_FMT \