summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-04-09 16:19:13 -0400
committerjim-p <jim@pingle.org>2009-04-09 16:19:13 -0400
commit5accf1301ac3bb5b03b7a37fcd86349a45ca16a5 (patch)
treefd04407d4653f35336842dee17ec5f2ea5b025ff /usr
parentd6cb86d1f0669ff3f59ca9bc444b8516d7ccefaa (diff)
downloadpfsense-5accf1301ac3bb5b03b7a37fcd86349a45ca16a5.zip
pfsense-5accf1301ac3bb5b03b7a37fcd86349a45ca16a5.tar.gz
Fix OpenVPN instance port change.
It had been failing on any change, including valid unused choices.
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/vpn_openvpn_client.php3
-rw-r--r--usr/local/www/vpn_openvpn_server.php3
2 files changed, 4 insertions, 2 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index 87832f4..b7e48c0 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -132,7 +132,8 @@ if ($_POST) {
if ($result = openvpn_validate_port($pconfig['local_port'], 'Local port'))
$input_errors[] = $result;
- if (openvpn_port_used($pconfig['protocol'], $pconfig['local_port']) != $vpnid)
+ $portused = openvpn_port_used($pconfig['protocol'], $pconfig['local_port']);
+ if (($portused != $vpnid) && ($portused != 0))
$input_errors[] = "The specified 'Local port' is in use. Please select another value";
}
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index f6a0a8d..3da69ae 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -177,7 +177,8 @@ if ($_POST) {
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'Local network'))
$input_errors[] = $result;
- if (openvpn_port_used($pconfig['protocol'], $pconfig['local_port']) != $vpnid)
+ $portused = openvpn_port_used($pconfig['protocol'], $pconfig['local_port']);
+ if (($portused != $vpnid) && ($portused != 0))
$input_errors[] = "The specified 'Local port' is in use. Please select another value";
if (!$tls_mode && !$pconfig['autokey_enable'])
OpenPOWER on IntegriCloud