Skip to content

Commit 93d9512

Browse files
committed
Change MAC addresses to be 52:55:55:XX:XX:XX
"5" is the magic number in the Lima ecosystem. (Visit https://en.wiktionary.org/wiki/lima and Command-F "five") But the second hex number is changed to 2 to satisfy the convention for local MAC addresses (https://en.wikipedia.org/wiki/MAC_address#Ranges_of_group_and_locally_administered_addresses) Signed-off-by: Akihiro Suda <[email protected]>
1 parent e8c524a commit 93d9512

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pkg/limayaml/defaults.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ import (
1313

1414
func MACAddress(uniqueID string) string {
1515
sha := sha256.Sum256([]byte(osutil.MachineID() + uniqueID))
16-
// According to https://gitlab.com/wireshark/wireshark/-/blob/master/manuf
17-
// no well-known MAC addresses start with 0x22.
18-
hw := append(net.HardwareAddr{0x22}, sha[0:5]...)
16+
// "5" is the magic number in the Lima ecosystem.
17+
// (Visit https://en.wiktionary.org/wiki/lima and Command-F "five")
18+
//
19+
// But the second hex number is changed to 2 to satisfy the convention for
20+
// local MAC addresses (https://en.wikipedia.org/wiki/MAC_address#Ranges_of_group_and_locally_administered_addresses)
21+
//
22+
// See also https://gitlab.com/wireshark/wireshark/-/blob/master/manuf to confirm the uniqueness of this prefix.
23+
hw := append(net.HardwareAddr{0x52, 0x55, 0x55}, sha[0:3]...)
1924
return hw.String()
2025
}
2126

0 commit comments

Comments
 (0)