From 0b9a77806902ca28f4c4080fb62d4e7f2c5643b2 Mon Sep 17 00:00:00 2001 From: Maurice Walker Date: Sun, 4 Apr 2021 14:00:21 +0200 Subject: [PATCH] NPTv6 configuration clean-up (#4894) * NPTv6 rule edit clean-up Internal and external prefix length must be the same. Remove dstmask input and use srcmsk for source and destination. "Invert" doesn't work for NPTv6. Remove. Rephrase text to avoid confusion and match terminology used in firewall_nat_npt.php (Internal / External vs. Source / Destination). * NPTv6 rule overview style fix Uppercase for consistency. --- src/www/firewall_nat_npt.php | 2 +- src/www/firewall_nat_npt_edit.php | 65 +++++++------------------------ 2 files changed, 15 insertions(+), 52 deletions(-) diff --git a/src/www/firewall_nat_npt.php b/src/www/firewall_nat_npt.php index da27319aa..e1c33b6a5 100644 --- a/src/www/firewall_nat_npt.php +++ b/src/www/firewall_nat_npt.php @@ -229,7 +229,7 @@ $main_buttons = array(   - + diff --git a/src/www/firewall_nat_npt_edit.php b/src/www/firewall_nat_npt_edit.php index 0da28c562..a2683ed19 100644 --- a/src/www/firewall_nat_npt_edit.php +++ b/src/www/firewall_nat_npt_edit.php @@ -53,18 +53,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } // load attributes with some kind of logic address_to_pconfig( - $a_npt[$configId]['source'], $pconfig['src'],$pconfig['srcmask'], $pconfig['srcnot'], - $pconfig['__unused__'],$pconfig['__unused__'] + $a_npt[$configId]['source'], $pconfig['src'], $pconfig['srcmask'], + $pconfig['__unused__'], $pconfig['__unused__'], $pconfig['__unused__'] ); address_to_pconfig( - $a_npt[$configId]['destination'], $pconfig['dst'],$pconfig['dstmask'], $pconfig['dstnot'], - $pconfig['__unused__'],$pconfig['__unused__'] + $a_npt[$configId]['destination'], $pconfig['dst'], + $pconfig['__unused__'], $pconfig['__unused__'], $pconfig['__unused__'], $pconfig['__unused__'] ); } // initialize empty form values - foreach (array('disabled','interface','descr','src','srcmask','dst','dstmask','srcnot','dstnot') as $fieldname) { + foreach (array('disabled','interface','descr','src','srcmask','dst') as $fieldname) { if (!isset($pconfig[$fieldname])) { $pconfig[$fieldname] = null; } @@ -107,11 +107,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $natent['descr'] = $pconfig['descr']; $natent['interface'] = $pconfig['interface']; pconfig_to_address( - $natent['source'], trim($pconfig['src']),$pconfig['srcmask'], !empty($pconfig['srcnot']) + $natent['source'], trim($pconfig['src']), $pconfig['srcmask'] ); pconfig_to_address( - $natent['destination'], trim($pconfig['dst']),$pconfig['dstmask'], !empty($pconfig['dstnot']) + $natent['destination'], trim($pconfig['dst']), $pconfig['srcmask'] ); if (isset($id)) { @@ -158,7 +158,7 @@ $( document ).ready(function() {
- + - - - - - - - - + - - - - - - - - +
@@ -194,24 +194,12 @@ $( document ).ready(function() {
- /> - -
- "/> + "/>
- /> - -
- - - - - -
- "/> - - -
+ "/>