diff options
-rw-r--r-- | etc/inc/shaper.inc | 3 | ||||
-rwxr-xr-x | usr/local/www/firewall_shaper_layer7.php | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc index 2de44aa..b56d806 100644 --- a/etc/inc/shaper.inc +++ b/etc/inc/shaper.inc @@ -3277,7 +3277,7 @@ class layer7 { //Add a tuple (rule,sctructure,element) to the $rsets function add_rule($l7set) { - $this->rsets[] = $l7set; + $this->rsets[] = $l7set; } // Build the layer7 rules @@ -3302,6 +3302,7 @@ class layer7 { $rsets = $q['l7rules']; //Put individual rules in the array if(is_array($rsets)) { + $this->rsets = array(); // XXX: ugly hack foreach($rsets as $l7r) { $l7obj = new l7rule(); $l7obj->SetRProtocol($l7r['protocol']); diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php index 84f3315..b9fb4f6 100755 --- a/usr/local/www/firewall_shaper_layer7.php +++ b/usr/local/www/firewall_shaper_layer7.php @@ -66,8 +66,6 @@ $default_layer7shaper_msg .= "</td></tr>"; read_layer7_config(); if($_GET['reset'] <> "") { - /* XXX: Huh!? Why are we killing php here? */ - mwexec("killall -9 pfctl php"); // kill all ipfw-classifyd processes mwexec("killall -9 ipfw-classifyd"); exit; @@ -124,8 +122,13 @@ else if ($_POST) { unset($input_errors); if($_POST['submit']) { - $l7r =& new layer7(); - $_POST['divert_port'] = $l7r->gen_divert_port(); + if (isset($layer7_rules_list[$name])) { + $l7r = $layer7_rules_list[$name]; + $_POST['divert_port'] = $l7r->GetRPort(); + } else { + $l7r =& new layer7(); + $_POST['divert_port'] = $l7r->gen_divert_port(); + } for($i=0; $_POST['protocol'][$i] <> ""; $i++) { $_POST['l7rules'][$i]['protocol'] = $_POST['protocol'][$i]; $_POST['l7rules'][$i]['structure'] = $_POST['structure'][$i]; |