From fc4e79ed06a1f086fc5d8406ae58364034d81403 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 4 Sep 2020 11:28:49 -0700 Subject: [PATCH] Fix bug in converting /12 addresses to netmasks https://github.com/webmin/webmin/issues/1292 --- webmin/webmin-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webmin/webmin-lib.pl b/webmin/webmin-lib.pl index 1fdcdb799..30447b3dd 100755 --- a/webmin/webmin-lib.pl +++ b/webmin/webmin-lib.pl @@ -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"; }