summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/firewall_nat_edit.php61
1 files changed, 37 insertions, 24 deletions
diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php
index f0aea90..2de7d4b 100644
--- a/src/usr/local/www/firewall_nat_edit.php
+++ b/src/usr/local/www/firewall_nat_edit.php
@@ -531,7 +531,7 @@ if ($_POST) {
}
function build_srctype_list() {
- global $pconfig, $ifdisp;
+ global $pconfig, $ifdisp, $config;
$list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network');
@@ -553,6 +553,26 @@ function build_srctype_list() {
return($list);
}
+function srctype_selected() {
+ global $pconfig, $config;
+
+ $selected = "";
+
+ $sel = is_specialnet($pconfig['src']);
+ if (!$sel) {
+ if ($pconfig['srcmask'] == 32) {
+ $selected = 'single';
+ } else {
+ $selected = 'network';
+ }
+ } else {
+ $selected = $pconfig['src'];
+ }
+
+
+ return($selected);
+}
+
function build_dsttype_list() {
global $pconfig, $config, $ifdisp;
@@ -599,33 +619,26 @@ function build_dsttype_list() {
}
function dsttype_selected() {
- global $pconfig;
-
- $sel = is_specialnet($pconfig['dst']);
-
- if (!$sel) {
- if ($pconfig['dstmask'] == 32)
- return('single');
-
- return('network');
- }
-
- return($pconfig['dst']);
-}
-
-function srctype_selected() {
- global $pconfig;
-
- $sel = is_specialnet($pconfig['src']);
+ global $pconfig, $config;
- if (!$sel) {
- if ($pconfig['srcmask'] == 32)
- return('single');
+ $selected = "";
- return('network');
+ if (is_array($config['virtualip']['vip'])) {
+ $selected = $pconfig['dst'];
+ } else {
+ $sel = is_specialnet($pconfig['dst']);
+ if (!$sel) {
+ if ($pconfig['dstmask'] == 32) {
+ $selected = 'single';
+ } else {
+ $selected = 'network';
+ }
+ } else {
+ $selected = $pconfig['dst'];
+ }
}
- return($pconfig['src']);
+ return($selected);
}
$closehead = false;
OpenPOWER on IntegriCloud