aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2012-03-14 15:10:25 +0545
committerPhil Davis <phil.davis@world.inf.org>2012-03-14 15:10:25 +0545
commitd436abb9d5574c72bcc5b52ac2dd68468e4544ec (patch)
tree63d3d9e5d3a4c02ed419597a51f9c6cb4d978f6c /config
parent66f0c5a5d24d2956b6c8692acdcb365ddf2edd17 (diff)
downloadpfsense-packages-d436abb9d5574c72bcc5b52ac2dd68468e4544ec.tar.gz
pfsense-packages-d436abb9d5574c72bcc5b52ac2dd68468e4544ec.tar.bz2
pfsense-packages-d436abb9d5574c72bcc5b52ac2dd68468e4544ec.zip
Put pfblocker.inc back the way it was. I didn't mean to change it in this fork.
Diffstat (limited to 'config')
-rwxr-xr-xconfig/pf-blocker/pfblocker.inc35
1 files changed, 17 insertions, 18 deletions
diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc
index 1a32906f..57d73b57 100755
--- a/config/pf-blocker/pfblocker.inc
+++ b/config/pf-blocker/pfblocker.inc
@@ -368,26 +368,25 @@ function sync_package_pfblocker() {
}
}
#update pfsense alias table
- if (is_array($config['aliases']['alias'])){
+ if (is_array($config['aliases']['alias']))
$aliases=$config['aliases']['alias'];
- foreach($aliases as $cbalias){
- if (preg_match("/pfBlocker/",$cbalias['name'])){
- #mark pfctl aliastable for cleaning
- if (!in_array($cbalias['name'], $aliases_list))
- $aliases_list[]=$cbalias['name']; #mark aliastable for cleaning
- #remove previous aliastable file if alias is not defined any more
- if (!in_array($cbalias['name'], $new_aliases_list))
- unlink_if_exists("/var/db/aliastables/".$cbalias['name'].".txt");
- }
- else{
- $new_aliases[]= $cbalias;
- if (file_exists($pfb_alias_dir.'/'.$alias.'.txt') && $message ==""){
- preg_match("/(\d+)/",exec("/usr/bin/wc -l ".$pfb_alias_dir.'/'.$alias.'.txt'),$matches);
- }
- if (($matches[1] * 2.1)>= $table_limit )
- #alias table too large
- $message= $alias .' alias table is too large. Reduce networks in list or increase "Firewall Maximum Table Entries" value to at least '. (int)($matches[1] * 2.1) .' in "system - advanced - Firewall/NAT".';
+ foreach($aliases as $cbalias){
+ if (preg_match("/pfBlocker/",$cbalias['name'])){
+ #mark pfctl aliastable for cleaning
+ if (!in_array($cbalias['name'], $aliases_list))
+ $aliases_list[]=$cbalias['name']; #mark aliastable for cleaning
+ #remove previous aliastable file if alias is not defined any more
+ if (!in_array($cbalias['name'], $new_aliases_list))
+ unlink_if_exists("/var/db/aliastables/".$cbalias['name'].".txt");
+ }
+ else{
+ $new_aliases[]= $cbalias;
+ if (file_exists($pfb_alias_dir.'/'.$alias.'.txt') && $message ==""){
+ preg_match("/(\d+)/",exec("/usr/bin/wc -l ".$pfb_alias_dir.'/'.$alias.'.txt'),$matches);
}
+ if (($matches[1] * 2.1)>= $table_limit )
+ #alias table too large
+ $message= $alias .' alias table is too large. Reduce networks in list or increase "Firewall Maximum Table Entries" value to at least '. (int)($matches[1] * 2.1) .' in "system - advanced - Firewall/NAT".';
}
}
#apply new alias table to xml