From 2c19058ab0920c4f93704975cf9c53deb3af3b97 Mon Sep 17 00:00:00 2001 From: nott Date: Thu, 16 Aug 2012 13:54:27 +0000 Subject: [PATCH] fix check ofclient name git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13533 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index e6b9507f9..6d383d988 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -293,16 +293,28 @@ if ($inet6support) { @clients = gethostbyaddr($conn->peeraddr,AF_INET); } - my $validclient=0; - my $node; - foreach my $client (@clients) { - $client =~ s/\..*//; - ($node) = noderange($client); #ensure this is coming from a node IP at least - if ($node) { #Means the source isn't a valid deal... - $validclient=1; - last; - } - } + my $validclient=0; + my $node; + my $domain; + my ($tmp) = $sitetab->getAttribs({'key'=>'domain'},'value'); + if (defined $tmp->{value}) { + $domain = $tmp->{value}; + } + foreach my $client (@clients) { + $client =~ s/\..*//; + if ($domain) { + $client =~ s/\.$domain//; + } else { + $client =~ s/\..*//; + } + #ensure this is coming from a node IP at least + ($node) = noderange($client); + if ($node) { #Means the source isn't valid + $validclient=1; + last; + } + } + unless ($validclient) { close($conn); next;