diff options
author | jim-p <jimp@pfsense.org> | 2010-11-19 10:28:08 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-11-19 10:31:56 -0500 |
commit | 5708241f9545924e07c820deecae5455354a6cbc (patch) | |
tree | cd59e68734813fd8c4d95e9015fc42a83b284d44 | |
parent | ad88ff3f95b91dd04d2c988a11cce75eacb54358 (diff) | |
download | pfsense-5708241f9545924e07c820deecae5455354a6cbc.zip pfsense-5708241f9545924e07c820deecae5455354a6cbc.tar.gz |
When the local port is left blank on an OpenVPN client, use 'lport 0' to direct the client to use a random source port. Fixes #1025
-rw-r--r-- | etc/inc/openvpn.inc | 6 | ||||
-rw-r--r-- | usr/local/www/vpn_openvpn_client.php | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index cab5467..6d3062c 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -447,9 +447,9 @@ function openvpn_reconfigure($mode,& $settings) { // The port we'll listen at // If local_port is used, bind the management port - if ($settings['local_port']) { - $conf .= "lport {$settings['local_port']}\n"; - } + $lport = ($settings['local_port']) ? $settings['local_port'] : "0"; + $conf .= "lport {$lport}\n"; + // Use unix socket to overcome the problem on any type of server $conf .= "management {$g['varetc_path']}/openvpn/{$mode_id}.sock unix\n"; diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index 04bbeb9..e92d82e 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -479,7 +479,7 @@ if ($savemsg) <td width="78%" class="vtable"> <input name="local_port" type="text" class="formfld unknown" size="5" value="<?=htmlspecialchars($pconfig['local_port']);?>"/> <br/> - <?=gettext("Set this option if you would like to bind to a specific port"); ?>. + <?=gettext("Set this option if you would like to bind to a specific port. Leave this blank or enter 0 for a random dynamic port."); ?> </td> </tr> <tr> |