2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-11 15:50:11 +00:00

fix for bug 4650: check if the kvm hypervisor hostname could be resolved

This commit is contained in:
ligc
2015-06-23 02:40:52 -04:00
parent eae685c247
commit b76e9a425a

View File

@ -341,6 +341,10 @@ sub nodesockopen {
unless ($node) { return 0; }
my $socket;
my $addr = gethostbyname($node);
if (!$addr) {
xCAT::SvrUtils::sendmsg([1,"Cannot not resolve host $node"], $callback);
return 0;
}
my $sin = sockaddr_in($port,$addr);
my $proto = getprotobyname('tcp');
socket($socket,PF_INET,SOCK_STREAM,$proto) || return 0;