diff options
author | jim-p <jimp@pfsense.org> | 2013-01-24 13:50:37 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-01-24 13:54:29 -0500 |
commit | a28d40cb7ea26bcfb28b1be3ad533058286b8e7f (patch) | |
tree | 8dcd27dd40a96dedbadf392f162e6b228ec58f1c /usr/local/www/vpn_openvpn_client.php | |
parent | f657f5e1e407a4687983b6e9907f0dc489945157 (diff) | |
download | pfsense-a28d40cb7ea26bcfb28b1be3ad533058286b8e7f.zip pfsense-a28d40cb7ea26bcfb28b1be3ad533058286b8e7f.tar.gz |
Allow specifying multiple local/remote networks for OpenVPN separated by commas. While I'm here, fix up the IPv6 tunnel/remote/local network input validation. Simplify some code using functions.
Diffstat (limited to 'usr/local/www/vpn_openvpn_client.php')
-rw-r--r-- | usr/local/www/vpn_openvpn_client.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php index 2e2a3f9..4a1cd5d 100644 --- a/usr/local/www/vpn_openvpn_client.php +++ b/usr/local/www/vpn_openvpn_client.php @@ -203,10 +203,17 @@ if ($_POST) { } if($pconfig['tunnel_network']) - if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'Tunnel network')) + if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network', false, "ipv4")) $input_errors[] = $result; - if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'Remote network')) + if($pconfig['tunnel_networkv6']) + if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], 'IPv6 Tunnel Network', false, "ipv6")) + $input_errors[] = $result; + + if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) + $input_errors[] = $result; + + if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) $input_errors[] = $result; if (!empty($pconfig['use_shaper']) && (!is_numeric($pconfig['use_shaper']) || ($pconfig['use_shaper'] <= 0))) |