diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index 913a5d140..de2fd64fa 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -525,6 +525,10 @@ sub refresh_switch { } unless ($session) { return; } my $bridgetoifmap = walkoid($session,'.1.3.6.1.2.1.17.1.4.1.2',ciscowarn=>$iscisco); # Good for all switches + if (not ref $bridgetoifmap or !keys %{$bridgetoifmap}) { + xCAT::MsgUtils->message("S","Error communicating with ".$session->{DestHost}.": failed to get a valid response to BRIDGE-MIB request"); + return; + } # my $mactoindexmap = walkoid($session,'.1.3.6.1.2.1.17.4.3.1.2'); my $mactoindexmap = walkoid($session,'.1.3.6.1.2.1.17.7.1.2.2.1.2',silentfail=>1); @@ -532,6 +536,10 @@ sub refresh_switch { #$mactoindexmap = walkoid($session,'.1.3.6.1.2.1.17.7.1.2.2.1.2'); $mactoindexmap = walkoid($session,'.1.3.6.1.2.1.17.4.3.1.2',ciscowarn=>$iscisco); } #Ok, time to process the data + if (not ref $mactoindexmap or !keys %{$mactoindexmap}) { + xCAT::MsgUtils->message("S","Error communicating with ".$session->{DestHost}.": Unable to get MAC entries via either BRIDGE or Q-BRIDE MIB"); + return; + } foreach my $oid (keys %$namemap) { #$oid =~ m/1.3.6.1.2.1.31.1.1.1.1.(.*)/; my $ifindex = $oid; diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index a40dd1383..7521e6b22 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -520,6 +520,7 @@ sleep 0.05; $req->{'_xcat_clientip'}=inet_ntoa($client); $req->{'_xcat_clientport'}=$sport; if (defined($cmd_handlers{"findme"}) and xCAT::Utils->nodeonmynet(inet_ntoa($client))) { #only discover from ips that appear to be on a managed network + xCAT::MsgUtils->message("S","xcatd: Processing discovery request from ".$req->{'_clientip'}); $req->{cacheonly}->[0] = 1; plugin_command($req,undef,\&build_response); if ($req->{cacheonly}->[0]) { @@ -532,7 +533,9 @@ sleep 0.05; # } } - } + } else { + xCAT::MsgUtils->message("S","xcatd: Skipping discovery from ".inet_ntoa($client)." because we either have no discovery plugins or the client address does not match an IP network that xCAT is managing"); + } } if ($quit) { last; } while ($select->can_read(0)) { #grab any incoming requests during run