From 59345b3cef9500261fa5cf41c44b61f48088a4a7 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 26 Aug 2010 17:10:00 -0300 Subject: Fix associated rule source address changes on NAT Port Forward When we change the source address on a NAT Port Forward rule that had an associated rule, we need to change the associated rule source address as well --- usr/local/www/firewall_nat_edit.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'usr/local/www/firewall_nat_edit.php') diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index ceded3d..7f75f83 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -362,17 +362,14 @@ if ($_POST) { // If a rule already exists, load it if (!empty($natent['associated-rule-id'])) { $filterentid = get_id($natent['associated-rule-id'], $config['filter']['rule']); - if ($filterentid == false) { - pconfig_to_address($filterent['source'], $_POST['src'], - $_POST['srcmask'], $_POST['srcnot'], - $_POST['srcbeginport'], $_POST['srcendport']); + if ($filterentid == false) $filterent['associated-rule-id'] = $natent['associated-rule-id']; - } else + else $filterent =& $config['filter']['rule'][$filterentid]; - } else - pconfig_to_address($filterent['source'], $_POST['src'], - $_POST['srcmask'], $_POST['srcnot'], - $_POST['srcbeginport'], $_POST['srcendport']); + } + pconfig_to_address($filterent['source'], $_POST['src'], + $_POST['srcmask'], $_POST['srcnot'], + $_POST['srcbeginport'], $_POST['srcendport']); // Update interface, protocol and destination $filterent['interface'] = $_POST['interface']; -- cgit v1.1