ipv6 fix: when then net and mask are IPv4 ones, the ip may be IPv6
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6296 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
aca218eae7
commit
f8b28be009
@ -330,6 +330,10 @@ sub ishostinsubnet {
|
||||
my $bip = Net::IP::ip_iptobin($eip,6);
|
||||
my $bipnet = $bip & $bmask;
|
||||
my $bnet = Net::IP::ip_iptobin($enet,6);
|
||||
if (!$bipnet || !$bnet)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if ($bipnet == $bnet) {
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user