isInSameSubnet: error condition check

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8897 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2011-02-21 07:20:14 +00:00
parent c3379c7e67
commit 654b2a0fc9

View File

@ -2607,6 +2607,11 @@ sub isInSameSubnet
$ip1 = xCAT::NetworkUtils->getipaddr($ip1);
$ip2 = xCAT::NetworkUtils->getipaddr($ip2);
if (!defined($ip1) || !defined($ip2))
{
return undef;
}
if ((($ip1 =~ /\d+\.\d+\.\d+\.\d+/) && ($ip2 !~ /\d+\.\d+\.\d+\.\d+/))
||(($ip1 !~ /\d+\.\d+\.\d+\.\d+/) && ($ip2 =~ /\d+\.\d+\.\d+\.\d+/)))
{