summaryrefslogtreecommitdiffstats
path: root/usr/local/www/vpn_ipsec_phase2.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-10-05 18:04:41 +0000
committerErmal <eri@pfsense.org>2012-10-05 18:04:41 +0000
commit261e72f0580b7ba29ccc58a4236f62e8a0387187 (patch)
tree9253d59092be7c9684730e291bab9d8d73f98b31 /usr/local/www/vpn_ipsec_phase2.php
parent64eda26c1efa0305824edbfb0ad37703a5f64ca3 (diff)
downloadpfsense-261e72f0580b7ba29ccc58a4236f62e8a0387187.zip
pfsense-261e72f0580b7ba29ccc58a4236f62e8a0387187.tar.gz
Do not make natlocalid required
Diffstat (limited to 'usr/local/www/vpn_ipsec_phase2.php')
-rw-r--r--usr/local/www/vpn_ipsec_phase2.php35
1 files changed, 19 insertions, 16 deletions
diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php
index 90774e9..65e49a5 100644
--- a/usr/local/www/vpn_ipsec_phase2.php
+++ b/usr/local/www/vpn_ipsec_phase2.php
@@ -131,16 +131,6 @@ if ($_POST) {
$input_errors[] = gettext("A valid local network IP address must be specified.");
break;
}
- switch ($pconfig['natlocalid_type']) {
- case "network":
- if (($pconfig['natlocalid_netbits'] != 0 && !$pconfig['natlocalid_netbits']) || !is_numeric($pconfig['natlocalid_netbits']))
- $input_errors[] = gettext("A valid nat local network bit count must be specified.");
- case "address":
- if (!empty($pconfig['natlocalid_address']) && !is_ipaddr($pconfig['natlocalid_address']))
- $input_errors[] = gettext("A valid nat local network IP address must be specified.");
- break;
- }
-
/* Check if the localid_type is an interface, to confirm if it has a valid subnet. */
if (is_array($config['interfaces'][$pconfig['localid_type']])) {
// Don't let an empty subnet into racoon.conf, it can cause parse errors. Ticket #2201.
@@ -150,13 +140,26 @@ if ($_POST) {
if (empty($address) || empty($netbits))
$input_errors[] = gettext("Invalid Local Network.") . " " . convert_friendly_interface_to_friendly_descr($pconfig['localid_type']) . " " . gettext("has no subnet.");
}
- if (is_array($config['interfaces'][$pconfig['natlocalid_type']])) {
- // Don't let an empty subnet into racoon.conf, it can cause parse errors. Ticket #2201.
- $address = get_interface_ip($pconfig['natlocalid_type']);
- $netbits = get_interface_subnet($pconfig['natlocalid_type']);
- if (empty($address) || empty($netbits))
- $input_errors[] = gettext("Invalid Local Network.") . " " . convert_friendly_interface_to_friendly_descr($pconfig['localid_type']) . " " . gettext("has no subnet.");
+ if (!empty($pconfig['natlocalid_type'])) {
+ switch ($pconfig['natlocalid_type']) {
+ case "network":
+ if (($pconfig['natlocalid_netbits'] != 0 && !$pconfig['natlocalid_netbits']) || !is_numeric($pconfig['natlocalid_netbits']))
+ $input_errors[] = gettext("A valid nat local network bit count must be specified.");
+ case "address":
+ if (!empty($pconfig['natlocalid_address']) && !is_ipaddr($pconfig['natlocalid_address']))
+ $input_errors[] = gettext("A valid nat local network IP address must be specified.");
+ break;
+ }
+
+ if (is_array($config['interfaces'][$pconfig['natlocalid_type']])) {
+ // Don't let an empty subnet into racoon.conf, it can cause parse errors. Ticket #2201.
+ $address = get_interface_ip($pconfig['natlocalid_type']);
+ $netbits = get_interface_subnet($pconfig['natlocalid_type']);
+
+ if (empty($address) || empty($netbits))
+ $input_errors[] = gettext("Invalid Local Network.") . " " . convert_friendly_interface_to_friendly_descr($pconfig['natlocalid_type']) . " " . gettext("has no subnet.");
+ }
}
switch ($pconfig['remoteid_type']) {
OpenPOWER on IntegriCloud