summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-11-09 08:03:38 -0800
committerRenato Botelho <garga@FreeBSD.org>2013-11-12 15:06:44 -0200
commitd07a2a2a672b6cd3d151358157d8ef3db3079901 (patch)
tree7b0b2aa4ab05c35bf6f7cfa77c31b2e7f6704007 /etc
parent2ffc7dc3cf1f37403bfc66e0bd4a15424bfa9a51 (diff)
downloadpfsense-d07a2a2a672b6cd3d151358157d8ef3db3079901.zip
pfsense-d07a2a2a672b6cd3d151358157d8ef3db3079901.tar.gz
Handle comma-separated list of remote networks when making vpn_networks table
If remote_networks for an OpenVPN instance is a list of more than 1 network then none of the networks gets added to the vpn_networks table. The code simply did not address this new comma-separated list feature. Now it does, and the vpn_networks table contains all the remote networks listed. Related to forum thread: http://forum.pfsense.org/index.php/topic,66776.msg377169.html#msg377169 and bug report #3309 - but from the bug report, there might be some other issue to be addressed also.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 03d6f4d..4eb35b6 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -791,8 +791,11 @@ function filter_get_vpns_list() {
foreach ($config['openvpn']["openvpn-$type"] as $settings) {
if(is_array($settings)) {
if (!isset($settings['disable'])) {
- if (is_subnet($settings['remote_network']) && $settings['remote_network'] <> "0.0.0.0/0")
- $vpns_arr[] = $settings['remote_network'];
+ $remote_networks = explode(',', $settings['remote_network']);
+ foreach ($remote_networks as $remote_network) {
+ if (is_subnet($remote_network) && ($remote_network <> "0.0.0.0/0"))
+ $vpns_arr[] = $remote_network;
+ }
if (is_subnet($settings['tunnel_network']) && $settings['tunnel_network'] <> "0.0.0.0/0")
$vpns_arr[] = $settings['tunnel_network'];
}
OpenPOWER on IntegriCloud