aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2012-03-14 14:53:56 +0545
committerPhil Davis <phil.davis@world.inf.org>2012-03-14 14:53:56 +0545
commit66f0c5a5d24d2956b6c8692acdcb365ddf2edd17 (patch)
tree07c7cbf9a41aebab764152cecf71d00b44e4f29d /config
parentec4b94c88d7208170f2f2e2f32cd434246ca2971 (diff)
downloadpfsense-packages-66f0c5a5d24d2956b6c8692acdcb365ddf2edd17.tar.gz
pfsense-packages-66f0c5a5d24d2956b6c8692acdcb365ddf2edd17.tar.bz2
pfsense-packages-66f0c5a5d24d2956b6c8692acdcb365ddf2edd17.zip
Update config/pf-blocker/pfblocker.inc
Diffstat (limited to 'config')
-rwxr-xr-xconfig/pf-blocker/pfblocker.inc35
1 files changed, 18 insertions, 17 deletions
diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc
index 57d73b57..1a32906f 100755
--- a/config/pf-blocker/pfblocker.inc
+++ b/config/pf-blocker/pfblocker.inc
@@ -368,25 +368,26 @@ 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);
+ 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".';
}
- 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