From 2f7d97f8647f01242d400e9561f5b0d5ce8d4047 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 12 May 2010 17:12:36 +0000 Subject: [PATCH] -If requested to generate mac addresses in one of vmware's ouis, mask out two bits git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6075 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/VMCommon.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/perl-xCAT/xCAT/VMCommon.pm b/perl-xCAT/xCAT/VMCommon.pm index 6c6b7de85..a42ad4c84 100644 --- a/perl-xCAT/xCAT/VMCommon.pm +++ b/perl-xCAT/xCAT/VMCommon.pm @@ -213,6 +213,9 @@ sub genMac { #Generates a mac address for a node, does NOT assure uniqueness, ca my $prefix = shift; if ($prefix) { #Specific prefix requested, honor it my $tail = int(rand(0xffffff)); #With only 24 bits of space, use random bits; + if ($prefix eq '00:50:56') { #vmware reserves certain addresses in their scheme if this prefix used + $tail = $tail&0x3f; #mask out the two bits in question + } $tail = sprintf("%06x",$tail); $tail =~ s/(..)(..)(..)/:$1:$2:$3/; return $prefix.$tail;