2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 19:20:24 +00:00

Merge pull request #5391 from bybai/f_ip

fix check for leading zeroes in ip address when running makehosts
This commit is contained in:
zet809
2018-07-11 14:07:34 +08:00
committed by GitHub

View File

@@ -2156,7 +2156,7 @@ sub isIpaddr
return 0;
}
if ($1 > 255 || $1 == 0 || $2 > 255 || $3 > 255 || $4 > 255)
if ($1 > 255 || $1 =~ /^0/ || $2 > 255 || $2 =~ /^0\d/ || $3 > 255 || $3 =~ /^0\d/ || $4 > 255 || $4 =~ /^0\d/)
{
return 0;
}