From 40fa6ddeaca6b2b6ea02109efd07d31daa72da59 Mon Sep 17 00:00:00 2001 From: Erik Fonnesbeck Date: Fri, 20 Apr 2012 02:38:58 -0600 Subject: Allow optionally using the type of NAT reflection implementation used for 1:1 mappings with port forwards as well, in addition to allowing the old type, which is still useful in its own way. --- usr/local/www/firewall_nat_edit.php | 9 ++--- usr/local/www/system_advanced_firewall.php | 58 ++++++++++++++++++++---------- 2 files changed, 44 insertions(+), 23 deletions(-) (limited to 'usr') diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index 83cfd73..d0ab5ba 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -330,7 +330,7 @@ if ($_POST) { else unset($natent['nosync']); - if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "disable") + if ($_POST['natreflection'] == "enable" || $_POST['natreflection'] == "purenat" || $_POST['natreflection'] == "disable") $natent['natreflection'] = $_POST['natreflection']; else unset($natent['natreflection']); @@ -783,9 +783,10 @@ include("fbegin.inc"); ?> diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php index a8dcae1..9678fd8 100644 --- a/usr/local/www/system_advanced_firewall.php +++ b/usr/local/www/system_advanced_firewall.php @@ -59,10 +59,7 @@ $pconfig['maximumtableentries'] = $config['system']['maximumtableentries']; $pconfig['disablereplyto'] = isset($config['system']['disablereplyto']); $pconfig['disablenegate'] = isset($config['system']['disablenegate']); $pconfig['disablenatreflection'] = $config['system']['disablenatreflection']; -if (!isset($config['system']['enablebinatreflection'])) - $pconfig['disablebinatreflection'] = "yes"; -else - $pconfig['disablebinatreflection'] = ""; +$pconfig['enablebinatreflection'] = $config['system']['enablebinatreflection']; $pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout']; $pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']); $pconfig['disablescrub'] = isset($config['system']['disablescrub']); @@ -121,15 +118,21 @@ if ($_POST) { $config['system']['maximumstates'] = $_POST['maximumstates']; $config['system']['maximumtableentries'] = $_POST['maximumtableentries']; - if($_POST['disablenatreflection'] == "yes") - $config['system']['disablenatreflection'] = $_POST['disablenatreflection']; - else + if($_POST['natreflection'] == "proxy") { + unset($config['system']['disablenatreflection']); + unset($config['system']['enablenatreflectionpurenat']); + } else if($_POST['natreflection'] == "purenat") { unset($config['system']['disablenatreflection']); + $config['system']['enablenatreflectionpurenat'] = "yes"; + } else { + $config['system']['disablenatreflection'] = "yes"; + unset($config['system']['enablenatreflectionpurenat']); + } - if($_POST['disablebinatreflection'] == "yes") - unset($config['system']['enablebinatreflection']); - else + if($_POST['enablebinatreflection'] == "yes") $config['system']['enablebinatreflection'] = "yes"; + else + unset($config['system']['enablebinatreflection']); if($_POST['disablereplyto'] == "yes") $config['system']['disablereplyto'] = $_POST['disablereplyto']; @@ -380,33 +383,50 @@ function update_description(itemnum) { - + - /> - + +
+ +

+ +

+ +

+
- + +
+ - + - /> - + /> + +

+ +

+ -   + />
- + -- cgit v1.1