From e352c14b74a72662803815f0af9f7801b92b4291 Mon Sep 17 00:00:00 2001 From: nott Date: Fri, 2 Nov 2012 13:57:28 +0000 Subject: [PATCH] changes for multi-domain support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14228 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index b8d6580c9..8e9f2aaa2 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -308,11 +308,12 @@ if ($inet6support) { my $validclient=0; my $node; my $domain; - my ($tmp) = $sitetab->getAttribs({'key'=>'domain'},'value'); - if (defined $tmp->{value}) { - $domain = $tmp->{value}; - } + + my $nd = xCAT::NetworkUtils->getNodeDomains(\@clients); + my %nodedomains = %{$nd}; + foreach my $client (@clients) { + $domain = $nodedomains{$client}; $client =~ s/\..*//; if ($domain) { $client =~ s/\.$domain//; @@ -967,18 +968,23 @@ until ($quit) { $peername=undef; } populate_site_hash(); - $domain = $::XCATSITEVALS{domain}; - + if ($inet6support) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET6); } else { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); } - unless ($peerhost) { $peerhost = gethostbyaddr($connection->peeraddr,AF_INET); } $peerfqdn=$peerhost; my $peerhostorg=$peerhost; # save original with domain for validation + + my @hosts; + push (@hosts, $peerhost); + my $nd = xCAT::NetworkUtils->getNodeDomains(\@hosts); + my %nodedomains = %$nd; + $domain = $nodedomains{$peerhost}; + if ($domain) { # strip off domain if set $peerhost && $peerhost =~ s/\.$domain\.*$//;