Fix prefix to mask function

This commit is contained in:
Jamie Cameron
2008-11-13 18:47:36 +00:00
parent 73dc598857
commit bd3bbbb1fe

View File

@@ -147,7 +147,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";
}