forked from kubernetes/minikube
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More robust MAC address matching (kubernetes#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
- Loading branch information
Showing
5 changed files
with
50 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters