summaryrefslogtreecommitdiffstats
path: root/etc/inc/openvpn.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-03-29 17:22:32 +0000
committerErmal <eri@pfsense.org>2010-03-29 17:22:32 +0000
commitc7f60193594ccb20e22150c6058570fbc685ce75 (patch)
treee065b9ac0cc6600b70bf53dfdbcb698f95724b46 /etc/inc/openvpn.inc
parent9a985f9e4bb5ecd6b985d0e7e471d0d4240068ce (diff)
downloadpfsense-c7f60193594ccb20e22150c6058570fbc685ce75.zip
pfsense-c7f60193594ccb20e22150c6058570fbc685ce75.tar.gz
Ticket #449. Teach OpenVPN to reload only tunnels for the specified interface. Use this is rc.newwanip script to reload only these tunnels.
Diffstat (limited to 'etc/inc/openvpn.inc')
-rw-r--r--etc/inc/openvpn.inc18
1 files changed, 13 insertions, 5 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 19be97e..b96afad 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -653,7 +653,7 @@ function openvpn_resync($mode, & $settings) {
}
// Resync and restart all VPNs
-function openvpn_resync_all() {
+function openvpn_resync_all($interface = "") {
global $g, $config;
// delay our setup until the system
@@ -682,13 +682,21 @@ function openvpn_resync_all() {
}
*/
- if (is_array($config['openvpn']['openvpn-server']))
- foreach ($config['openvpn']['openvpn-server'] as & $settings)
+ if (is_array($config['openvpn']['openvpn-server'])) {
+ foreach ($config['openvpn']['openvpn-server'] as & $settings) {
+ if (!empty($interface) && $interface != $settings['interface'])
+ continue;
openvpn_resync('server', $settings);
+ }
+ }
- if (is_array($config['openvpn']['openvpn-client']))
- foreach ($config['openvpn']['openvpn-client'] as & $settings)
+ if (is_array($config['openvpn']['openvpn-client'])) {
+ foreach ($config['openvpn']['openvpn-client'] as & $settings) {
+ if (!empty($interface) && $interface != $settings['interface'])
+ continue;
openvpn_resync('client', $settings);
+ }
+ }
if (is_array($config['openvpn']['openvpn-csc']))
foreach ($config['openvpn']['openvpn-csc'] as & $settings)
OpenPOWER on IntegriCloud