Fix random MAC generation on Wired/WiFi

Review Request #124747 - Created Aug. 15, 2015 and submitted

Information
Boudhayan Gupta
plasma-nm
master
Reviewers
networkmanagement

Randomly generated MAC addresses aren't truly random; they should have an even first octet (LSB set to 0) to signify that this is an Unicast address, and the second least-significant-bit should be set to 1 to specify that it is a locally administered MAC, not a globally enforced one.

Setting the Multicast bit (current behaviour half the time) will result in the kernel refusing to set the randomly generated MAC address, with a small entry in Journalctl/Syslog:

[platform/nm-linux-platform.c:2782] do_change_link(): platform-linux: do-change-link: failure changing link 3: Invalid address for specified address family (19)

This small patch fixes random MAC generation for both Wired and WiFi connections

Builds, correctly generates random MACs with last two bits of first octet set to 10, saves said MAC.

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Lamarque Souza
Boudhayan Gupta
Lamarque Souza
Boudhayan Gupta
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit d66c6bd1ca0954ac7c4268f4f0538078ea6b6a29 by Boudhayan Gupta to branch master.
Loading...