From 5accf1301ac3bb5b03b7a37fcd86349a45ca16a5 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 9 Apr 2009 16:19:13 -0400 Subject: Fix OpenVPN instance port change. It had been failing on any change, including valid unused choices. --- usr/local/www/vpn_openvpn_client.php | 3 ++- usr/local/www/vpn_openvpn_server.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'usr') 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']) -- cgit v1.1