Change to inet_ntoa to determine ip address.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@565 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2008-02-25 15:08:04 +00:00
parent 350d9ca3f3
commit fd5e47ed76

View File

@ -1450,7 +1450,7 @@ sub isServiceReq
Used on the service node to figure out what hostname and ip address
the service node is in the database
Input: None TODO IPV6
Input: None
Output: nodename, ipaddress
=cut
@ -1467,8 +1467,7 @@ sub determinehostname
}
$hostname = $thostname[0];
my ($hcp, $aliases, $addtype, $length, @addrs) = gethostbyname($hostname);
my ($a, $b, $c, $d) = unpack('C4', $addrs[0]);
my $ipaddress = $a . "." . $b . "." . $c . "." . $d;
my $ipaddress = inet_ntoa($addrs[0]);
my @hostinfo = ($hostname, $ipaddress);
return @hostinfo;
}