diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index dc312b001..7e0f3db6f 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -2143,7 +2143,6 @@ sub process_request { last; } } - unless ($mac) { return }; #Only refresh the the cache when the request permits and no useful answer if ($macmaptimestamp < (time() - 300)) { #after five minutes, invalidate cache @@ -2158,7 +2157,19 @@ sub process_request { process_request(\%invreq,\&fillresps); } } - unless ($macmap{$mac}) { + my $found=0; + if ($mac and $macmap{$mac}) { + $found=1; + } else { + foreach (@{$request->{mac}}) { + /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; + if ($1 and $macmap{$1}) { + $found=1; + last; + } + } + } + unless ($found) { return 1; #failure } my $mactab = xCAT::Table->new('mac',-create=>1); diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index fd5f29506..98da62206 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -37,17 +37,20 @@ sub process_request { last; } } - unless ($mac) { - return; + my $node; + my $firstpass=1; + if ($mac) { + $node = $macmap->find_mac($mac,$req->{cacheonly}->[0]); + $firstpass=0; + } + if (not $node) { # and $req->{checkallmacs}->[0]) { + foreach (@{$req->{mac}}) { + /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; + $node = $macmap->find_mac($1,$firstpass); + $firstpass=0; + if ($node) { last; } + } } - my $node = $macmap->find_mac($mac,$req->{cacheonly}->[0]); - #if (not $node and $req->{checkallmacs}->[0]) { - # foreach (@{$req->{mac}}) { - # /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; - # $node = $macmap->find_mac($1,$req->{cacheonly}->[0]); - # if ($node) { last; } - # } - #} if ($node) { my $mactab = xCAT::Table->new('mac',-create=>1); diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 60b788b4c..584b9c3ce 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -357,7 +357,7 @@ if ($inet6support) { $req->{'_xcat_clienthost'}=gethostbyaddr($client,AF_INET); $req->{'_xcat_clientip'}=inet_ntoa($client); $req->{'_xcat_clientport'}=$sport; - if (defined($cmd_handlers{"findme"})) { + if (defined($cmd_handlers{"findme"}) and xCAT::Utils->nodeonmynet(inet_ntoa($client))) { #only discover from ips that appear to be on a managed network $req->{cacheonly}->[0] = 1; plugin_command($req,undef,\&build_response); if ($req->{cacheonly}->[0]) {