Fix OpenVPN instance port change.

It had been failing on any change, including valid unused choices.
This commit is contained in:
jim-p 2009-04-09 16:19:13 -04:00
parent d6cb86d1f0
commit 5accf1301a
2 changed files with 4 additions and 2 deletions

View File

@ -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";
}

View File

@ -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'])