mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-19 09:40:21 +00:00
-Move rng seeding
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4289 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
@@ -55,6 +55,7 @@ sub getMacAddresses {
|
||||
$updatesneeded = 1;
|
||||
}
|
||||
|
||||
srand(); #Re-seed the rng. This will make the mac address generation less deterministic
|
||||
while ($count > 0) { #still need more, autogen
|
||||
$macaddr = "";
|
||||
while (not $macaddr) {
|
||||
@@ -85,7 +86,6 @@ sub getMacAddresses {
|
||||
sub genMac { #Generates a mac address for a node, does NOT assure uniqueness, calling code needs to do that
|
||||
my $node=shift;
|
||||
my $prefix = shift;
|
||||
srand(); #Re-seed the rng. I haven't been able to reproduce it, but duplicate macs were somehow making it
|
||||
if ($prefix) { #Specific prefix requested, honor it
|
||||
my $tail = int(rand(0xffffff)); #With only 24 bits of space, use random bits;
|
||||
$tail = sprintf("%06x",$tail);
|
||||
|
Reference in New Issue
Block a user