From 17bdca227c26c4ab05bda4d413a5d1cd2787f8d8 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 10 May 2010 08:53:04 +0000 Subject: [PATCH] ipv6 fix, replace the Socket library calls with NetworkUtils subroutines git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6041 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/mysqlsetup | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/sbin/mysqlsetup b/xCAT-server/sbin/mysqlsetup index 47cadc930..21f61ebc5 100755 --- a/xCAT-server/sbin/mysqlsetup +++ b/xCAT-server/sbin/mysqlsetup @@ -30,6 +30,7 @@ BEGIN use lib "$::XCATROOT/lib/perl"; use DBI; use xCAT::Utils; +use xCAT::NetworkUtils; use Getopt::Long; use xCAT::MsgUtils; use xCAT::Table; @@ -267,10 +268,11 @@ if ($::INIT) chomp $hname; } - my ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($hname); - if ($? == 0) + #my ($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($hname); + my $ipaddr = xCAT::NetworkUtils->getipaddr($hname); + if ($ipaddr) { - $::MN = inet_ntoa($addrs[0]); + $::MN = $ipaddr; } else {