diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-26 17:10:00 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-26 17:10:00 -0300 |
commit | 59345b3cef9500261fa5cf41c44b61f48088a4a7 (patch) | |
tree | d0d2eb0e51940e509f6d7b5e89f931b466ef16b3 /usr | |
parent | e57c91a28ef0723602c42cfd445c14ef7ce13087 (diff) | |
download | pfsense-59345b3cef9500261fa5cf41c44b61f48088a4a7.zip pfsense-59345b3cef9500261fa5cf41c44b61f48088a4a7.tar.gz |
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
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/firewall_nat_edit.php | 15 |
1 files changed, 6 insertions, 9 deletions
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']; |