# HG changeset patch # User Matti Hamalainen # Date 1250179987 -10800 # Node ID 29ddb6b9b52145aa59f79cb6bf055bcc3276cc81 # Parent ee5f7b8dcdea7d13ea006cc8046f586b829dc86c Moar changes! diff -r ee5f7b8dcdea -r 29ddb6b9b521 maltfilter --- a/maltfilter Thu Aug 13 18:55:55 2009 +0300 +++ b/maltfilter Thu Aug 13 19:13:07 2009 +0300 @@ -131,16 +131,15 @@ } -sub check_hosts_array(@$) +sub check_hosts_array($$) { - my @hostlist = shift; - my $chk_host = shift; + my $chk_host = $_[1]; my $chk_ip = new Net::IP($chk_host); - foreach my $host (@hostlist) { - my $ip = new Net::IP($host); + foreach my $host (@{$_[0]}) { if ($chk_host eq $host) { return 1; } + my $ip = new Net::IP($host); if (defined($chk_ip) && defined($ip)) { if ($chk_ip->binip() eq $ip->binip()) { return 1; @@ -152,7 +151,8 @@ sub check_hosts($$) { - return check_hosts_array(split(/\s*\|\s*/, $_[0]), $_[1]); + my @tmp = split(/\s*\|\s*/, $_[0]); + return check_hosts_array(\@tmp, $_[1]); } @@ -382,7 +382,7 @@ my $value = $2; if ($key eq "SCANFILE") { push(@scanfiles_def, $value); - elsif ($key eq "NOBLOCK_IPS") { + } elsif ($key eq "NOBLOCK_IPS") { push(@noblock_ips_def, $value); } elsif (defined($settings{$key})) { $settings{$key} = $value; @@ -425,6 +425,8 @@ die($msg); } +mlog(-1, "Not blocking following IPs: ".join(", ", @noblock_ips)."\n"); + # Initialize update_iplist(-1); malt_init();