network: ensure multicast bit is unset in random mac addresses

This commit is contained in:
Alex Zenla 2024-02-11 16:09:03 +00:00
parent f96f9d8abf
commit dbfc07b026
No known key found for this signature in database
GPG Key ID: 067B238899B51269
2 changed files with 2 additions and 0 deletions

View File

@ -85,6 +85,7 @@ impl Controller {
let mut mac = MacAddr6::random();
mac.set_local(true);
mac.set_multicast(false);
let ipv4 = self.allocate_ipv4()?;
let ipv6 = mac.to_link_local_ipv6();
let launch_config = LaunchInfo {

View File

@ -132,6 +132,7 @@ impl NetworkBackend {
let mac = self.force_mac_address.unwrap_or_else(|| {
let mut mac = MacAddr6::random();
mac.set_local(true);
mac.set_multicast(false);
mac
});
let mac = smoltcp::wire::EthernetAddress(mac.to_array());