From fd5e47ed768ff4bd010f74fe88e2271c07ed520e Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 25 Feb 2008 15:08:04 +0000 Subject: [PATCH] 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 --- perl-xCAT-2.0/xCAT/Utils.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/Utils.pm b/perl-xCAT-2.0/xCAT/Utils.pm index b1f82ab10..50177d562 100644 --- a/perl-xCAT-2.0/xCAT/Utils.pm +++ b/perl-xCAT-2.0/xCAT/Utils.pm @@ -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; }