diff options
author | jim-p <jimp@pfsense.org> | 2011-06-03 15:34:54 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-06-03 15:34:54 -0400 |
commit | 534375b6f0ad869022c068ef35c5c6dedcd619bd (patch) | |
tree | 7a756196aa5f720c2d4019bb1686e7ebd25bdc36 /etc/inc/openvpn.inc | |
parent | ee0cf21f7c71cc0d7630a0d607b1082424dc725b (diff) | |
parent | bd4b09826c4f0a6ecae94c99a9fdfa8bf7bc4a95 (diff) | |
download | pfsense-534375b6f0ad869022c068ef35c5c6dedcd619bd.zip pfsense-534375b6f0ad869022c068ef35c5c6dedcd619bd.tar.gz |
Merge remote branch 'upstream/master'
Conflicts:
etc/inc/openvpn.inc
Diffstat (limited to 'etc/inc/openvpn.inc')
-rw-r--r-- | etc/inc/openvpn.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 87d64ce..00f15ae 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -381,9 +381,9 @@ function openvpn_reconfigure($mode, $settings) { // server specific settings if ($mode == 'server') { - list($ip, $mask) = explode('/', $settings['tunnel_network']); + list($ip, $cidr) = explode('/', $settings['tunnel_network']); list($ipv6, $prefix) = explode('/', $settings['tunnel_networkv6']); - $mask = gen_subnet_mask($mask); + $mask = gen_subnet_mask($cidr); // configure tls modes switch($settings['mode']) { @@ -398,8 +398,13 @@ function openvpn_reconfigure($mode, $settings) { // configure p2p/server modes switch($settings['mode']) { case 'p2p_tls': - $conf .= "server {$ip} {$mask}\n"; - $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; + // If the CIDR is less than a /30, OpenVPN will complain if you try to + // use the server directive. It works for a single client without it. + // See ticket #1417 + if ($cidr < 30) { + $conf .= "server {$ip} {$mask}\n"; + $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; + } case 'p2p_shared_key': $baselong = ip2long32($ip) & ip2long($mask); $ip1 = long2ip32($baselong + 1); |