From 5708241f9545924e07c820deecae5455354a6cbc Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 19 Nov 2010 10:28:08 -0500 Subject: 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 --- etc/inc/openvpn.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'etc/inc/openvpn.inc') 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"; -- cgit v1.1