Skip to content

Commit

Permalink
extend mac randomness to 4 bytes (#211)
Browse files Browse the repository at this point in the history
Signed-off-by: Periyasamy Palanisamy <[email protected]>
  • Loading branch information
pperiyasamy authored Sep 30, 2021
1 parent 959f619 commit 3522e44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func getHardwareAddr(ifName string) string {
}

func generateRandomMac() net.HardwareAddr {
prefix := []byte{0x02, 0x00, 0x00} // local unicast prefix
suffix := make([]byte, 3)
prefix := []byte{0x0A, 0x58} // use private MAC prefix 0A:58
suffix := make([]byte, 4)
_, err := rand.Read(suffix)
if err != nil {
panic(err)
Expand Down

0 comments on commit 3522e44

Please sign in to comment.