ether-addr-util: split out logic to mark MAC addresses as random

This commit is contained in:
Lennart Poettering
2023-12-19 11:48:05 +09:00
committed by Yu Watanabe
parent 32c376a46c
commit e22ca70008
3 changed files with 11 additions and 3 deletions
+1 -3
View File
@@ -95,9 +95,7 @@ static int generate_mac(
assert_cc(ETH_ALEN <= sizeof(result));
memcpy(mac->ether_addr_octet, &result, ETH_ALEN);
/* see eth_random_addr in the kernel */
mac->ether_addr_octet[0] &= 0xfe; /* clear multicast bit */
mac->ether_addr_octet[0] |= 0x02; /* set local assignment bit (IEEE802) */
ether_addr_mark_random(mac);
return 0;
}