From d07a2a2a672b6cd3d151358157d8ef3db3079901 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 9 Nov 2013 08:03:38 -0800 Subject: 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. --- etc/inc/filter.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'etc') 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']; } -- cgit v1.1