From ee5060449502c103b83c05dcfa794a55f40789ea Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 14 Mar 2007 19:08:47 +0000 Subject: [PATCH] Fix ticket #1265 Multiple openvpn clients all attempt to bind to same local port --- etc/inc/openvpn.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 87a451635e..d00d03482e 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -218,7 +218,6 @@ daemon keepalive 10 60 ping-timer-rem persist-tun -lport $lport persist-key dev tun proto $proto @@ -259,6 +258,7 @@ EOD; // The port we'll listen at $openvpn_conf .= "lport {$settings['local_port']}\n"; + } else { // $mode == client @@ -267,6 +267,11 @@ EOD; if ($settings['auth_method'] == 'pki') $openvpn_conf .= "client\n"; + if ($settings['use_dynamicport']) $openvpn_conf .= "nobind\n"; + else + // The port we'll listen at + $openvpn_conf .= "lport {$lport}\n"; + if (!empty($settings['interface_ip'])) { // Configure the IPs according to the address pool list($ip, $mask) = explode('/', $settings['interface_ip']); @@ -451,4 +456,4 @@ function openvpn_print_javascript2() { EOD; print($javascript); } -?> \ No newline at end of file +?>