diff options
-rw-r--r-- | usr/local/www/wizards/openvpn_wizard.inc | 7 | ||||
-rw-r--r-- | usr/local/www/wizards/openvpn_wizard.xml | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc index 6fe2a41..87bae7f 100644 --- a/usr/local/www/wizards/openvpn_wizard.inc +++ b/usr/local/www/wizards/openvpn_wizard.inc @@ -297,8 +297,7 @@ function step10_stepbeforeformdisplay() { $pkg['step'][$stepid]['fields']['field'][$idx]['options']['option'][] = $opt; } } else if ($field['name'] == "localport") { - if (count($config['openvpn']['openvpn-server']) < 1) - $pkg['step'][$stepid]['fields']['field'][$idx]['value'] = 1194; + $pkg['step'][$stepid]['fields']['field'][$idx]['value'] = openvpn_port_next('UDP'); } } } @@ -306,9 +305,9 @@ function step10_stepbeforeformdisplay() { function step10_submitphpaction() { global $savemsg, $stepid; - /* Default OpenVPN port to 1194 if left empty. */ + /* Default OpenVPN port to next available port if left empty. */ if (empty($_POST['localport'])) - $_POST['localport'] = 1194; + $pconfig["step10"]["localport"] = openvpn_port_next('UDP'); /* input validation */ if ($result = openvpn_validate_port($_POST['localport'], 'Local port')) diff --git a/usr/local/www/wizards/openvpn_wizard.xml b/usr/local/www/wizards/openvpn_wizard.xml index 6e9f842..2bc6db1 100644 --- a/usr/local/www/wizards/openvpn_wizard.xml +++ b/usr/local/www/wizards/openvpn_wizard.xml @@ -600,11 +600,11 @@ <options> <option> <name>UDP</name> - <value>udp</value> + <value>UDP</value> </option> <option> <name>TCP</name> - <value>tcp</value> + <value>TCP</value> </option> </options> <description><br/>Protocol to use for OpenVPN connections. If you are unsure, leave this set to UDP.</description> |