summaryrefslogtreecommitdiffstats
path: root/src/nspawn/nspawn-network.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-12-18 14:47:47 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-12-19 03:48:05 +0100
commite22ca70008999ec451f2cf59a66d96cd067a3f15 (patch)
tree12d761052aff3dc56145957d131a19f483491707 /src/nspawn/nspawn-network.c
parenttest: add missing operators (diff)
downloadsystemd-e22ca70008999ec451f2cf59a66d96cd067a3f15.tar.xz
systemd-e22ca70008999ec451f2cf59a66d96cd067a3f15.zip
ether-addr-util: split out logic to mark MAC addresses as random
Diffstat (limited to '')
-rw-r--r--src/nspawn/nspawn-network.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/nspawn/nspawn-network.c b/src/nspawn/nspawn-network.c
index c661f1d9e0..369d8742b6 100644
--- a/src/nspawn/nspawn-network.c
+++ b/src/nspawn/nspawn-network.c
@@ -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;
}