Swap out Net::Subnets for Net::CIDR::Lite in PerformanceProfiler.

This commit is contained in:
Colin Kuskie 2010-03-17 13:25:04 -07:00
parent 570cdfd9f5
commit e77b2b9722

View file

@ -64,7 +64,7 @@ use Apache2::FilterRec;
use Apache2::RequestIO;
use Apache2::RequestRec;
use ModPerl::Util;
use Net::Subnets;
use Net::CIDR::Lite;
my @subTimes = ();
my $depth = 0;
@ -128,13 +128,11 @@ sub output {
return Apache2::Const::DECLINED unless($f->r->content_type =~ 'text/html');
my $server = Apache2::ServerUtil->server;
my $sn = $server->dir_config('ProfileSubnet');
my $subnet = [ $sn ];
if ($sn) {
my $conn = $f->c;
my $ipAddress = $conn->remote_ip;
my $net = Net::Subnets->new();
$net->subnets($subnet);
if (!$net->check(\$ipAddress)) {
my $net = Net::CIDR::Lite->new($sn);
if (!$net->find($ipAddress)) {
return Apache2::Const::DECLINED;
}
}