-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
baremetal: validate custom mac addresses are unicast
When users specify a custom MAC address for the provisioning and baremetal bridges of the libvirt bootstrap host, libvirt complains if the user does not give a unicast MAC address: ``` 020-11-13 10:52:18 level=debug msg=2020/11/13 10:52:18 [ERROR] module.bootstrap: eval: *terraform.EvalApplyPost, err: Error defining libvirt domain: virError(Code=27, Domain=20, Message='XML error: expected unicast mac address, found multicast '7D:CE:E3:29:35:6F'') ') ``` This adds a function that validates whether a MAC address is unicast. A multicast MAC address is one where the most significant byte has a least significant bit of `1`. Example 1: Multicast MAC ------------------------ 7D:CE:E3:29:35:6F ^--> most significant byte 0x7D is 0b11111101 ^--> this is a multicast MAC Example 2: Unicast MAC ---------------------- 7A:CE:E3:29:35:6F ^--> most significant byte 0x7A is 0b11111010 ^--> this is a unicast MAC
- Loading branch information
Showing
6 changed files
with
106 additions
and
8 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
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