2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #782 from jjohnson42/suppressbadmac

Suppress invalid mac data
This commit is contained in:
Jarrod Johnson 2016-03-07 15:31:58 -05:00
commit fea1629929

View File

@ -3772,13 +3772,17 @@ sub parseboard {
#time to process the mac field...
my $macdata = $boardinf{extra}->[6]->{value};
my $macstring = "1";
my $macprefix;
while ($macstring !~ /00:00:00:00:00:00/ and not ref $global_sessdata->{currmacs}) {
my @currmac = splice @$macdata,0,6;
unless ((scalar @currmac) == 6) {
last;
}
$macstring = sprintf("%02x:%02x:%02x:%02x:%02x:%02x",@currmac);
if ($macstring !~ /00:00:00:00:00:00/) {
unless ($macprefix) {
$macprefix = substr($macstring, 0, 8);
}
if ($macstring !~ /00:00:00:00:00:00/ and $macstring =~/^$macprefix/) {
push @{$boardinf{macaddrs}},$macstring;
}
}