ipv6 subroutines

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6017 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2010-05-07 09:56:01 +00:00
parent 932d6e0273
commit 4915e69508
2 changed files with 5 additions and 5 deletions

View File

@ -1862,7 +1862,7 @@ sub getNetwkInfo
chomp $NM;
chomp $net;
if(xCAT::Utils->ishostinsubnet($IP, $NM, $net))
if(xCAT::NetworkUtils->ishostinsubnet($IP, $NM, $net))
{
# fill in the hash -
foreach my $attr (@attrnames) {

View File

@ -117,8 +117,8 @@ sub gethostname()
{
if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6
{
my ($family, $socket, $protocol, $ip, $name) = getaddrinfo($iporhost,0);
my $host = (getnameinfo($ip))[0];
my ($family, $socket, $protocol, $ip, $name) = Socket6::getaddrinfo($iporhost,0);
my $host = (Socket6::getnameinfo($ip))[0];
if ($host eq $iporhost) # can not resolve
{
return undef;
@ -180,10 +180,10 @@ sub getipaddr()
{
if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6
{
my ($family, $socket, $protocol, $ip, $name) = getaddrinfo($iporhost,0);
my ($family, $socket, $protocol, $ip, $name) = Socket6::getaddrinfo($iporhost,0);
if ($ip)
{
return (getnameinfo($ip, NI_NUMERICHOST()))[0];
return (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0];
}
return undef;
}