diff options
author | Phil Davis <phil.davis@world.inf.org> | 2013-11-09 08:03:38 -0800 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-11-12 15:06:44 -0200 |
commit | d07a2a2a672b6cd3d151358157d8ef3db3079901 (patch) | |
tree | 7b0b2aa4ab05c35bf6f7cfa77c31b2e7f6704007 /etc | |
parent | 2ffc7dc3cf1f37403bfc66e0bd4a15424bfa9a51 (diff) | |
download | pfsense-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.inc | 7 |
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']; } |