Indicate that this is a locally administered MAC address.

Submitted by:	lidl
Differential Revision:	https://reviews.freebsd.org/D7903
This commit is contained in:
Marcelo Araujo 2016-09-27 17:37:23 +00:00
parent 615216628b
commit dc7c777336
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306371

View File

@ -96,8 +96,9 @@ link_getaddr(const char *addr, int which)
sdl.sdl_nlen = 0;
sdl.sdl_family = AF_LINK;
arc4random_buf(&sdl.sdl_data, ETHER_ADDR_LEN);
/* Non-multicast and claim it is a hardware address */
/* Non-multicast and claim it is locally administered. */
sdl.sdl_data[0] &= 0xfc;
sdl.sdl_data[0] |= 0x02;
} else {
if ((temp = malloc(strlen(addr) + 2)) == NULL)
errx(1, "malloc failed");