Fix bug in converting /12 addresses to netmasks https://github.com/webmin/webmin/issues/1292

This commit is contained in:
Jamie Cameron
2020-09-04 11:28:49 -07:00
parent 4a1abb0c10
commit fc4e79ed06

View File

@@ -1618,7 +1618,7 @@ sub prefix_to_mask
{
return $_[0] >= 24 ? "255.255.255.".(256-(2 ** (32-$_[0]))) :
$_[0] >= 16 ? "255.255.".(256-(2 ** (24-$_[0]))).".0" :
$_[0] >= 16 ? "255.".(256-(2 ** (16-$_[0]))).".0.0" :
$_[0] >= 8 ? "255.".(256-(2 ** (16-$_[0]))).".0.0" :
(256-(2 ** (8-$_[0]))).".0.0.0";
}