minikube/pkg/drivers/vfkit
Nir Soffer c090344bb4
More robust MAC address matching (#19750)
On darwin bootp uses non-standard MAC address format[1]:
"8e:1:99:9c:54:b1" instead of "8e:01:99:9c:54:b1". We fixed this by
trimming leading "0" in the string before looking up the IP address.

There are several issues with the current code:
- Fragile, will break if bootp changes the format (unlikely)
- Fixing the wrong place, the drivers should not care about the MAC
  address format.
- The tests were confusing, showing that we can match standard MAC
  addresses while the actual code could match only non-standard bootp
  addresses.
- Logging wrong MAC address since we trimmed leading zeros before
  logging

This change replace trimming leading zeros with parsing MAC address
strings and comparing the bytes. The test includes now both standard and
non-standard MAC addresses.

[1] https://openradar.appspot.com/FB15382970
2024-10-14 10:21:04 -07:00
..
vfkit.go More robust MAC address matching (#19750) 2024-10-14 10:21:04 -07:00