From a32fc3f11a09385eaf7709d99158363cdbf5e608 Mon Sep 17 00:00:00 2001 From: Vince Date: Wed, 10 Oct 2012 11:04:55 -0700 Subject: Net masking math was off by 1 Net masking math was off by 1 --- config/pf-blocker/pfblocker.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/pf-blocker/pfblocker.inc') diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc index 64171b01..53e2453e 100755 --- a/config/pf-blocker/pfblocker.inc +++ b/config/pf-blocker/pfblocker.inc @@ -70,7 +70,7 @@ function pfblocker_Range2CIDR($ip_min, $ip_max) { if ($bits < 0) return ""; #identify first ip on range network - $network=long2ip($ip_min_long & (2<<32)-(2<<(32-$bits))); + $network=long2ip($ip_min_long & (2<<32)-(2<<(31-$bits))); #print decbin($ip_min_long)."\n".$network."\n"; return $network . "/". $bits; } -- cgit v1.2.3