summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-05-07 20:19:49 +0545
committerPhil Davis <phil.davis@world.inf.org>2013-05-07 20:19:49 +0545
commitbe00850b9db59c1a477656aa82a9daf7183532a6 (patch)
tree84f9debe3a199c2437a6e56ad20d71cdb42b17c6
parente960b29837062f7b0348abaebfdc9c1cdc423b68 (diff)
downloadpfsense-be00850b9db59c1a477656aa82a9daf7183532a6.zip
pfsense-be00850b9db59c1a477656aa82a9daf7183532a6.tar.gz
Remember which interface was used by each OpenVPN conf
When interfaces go down and up we need to know which interface (vr1, vr2 etc) each OpenVPN instance is using so we can optimize our decision about which instances to resync. That data is not in the conf file (the conf file contains the IP address the instance binds to). This change puts the interface name into a little file in /var/etc/openvpn for later use.
-rw-r--r--etc/inc/openvpn.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index a5244fd..bd92642 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -744,9 +744,12 @@ function openvpn_reconfigure($mode, $settings) {
$fpath = "{$g['varetc_path']}/openvpn/{$mode_id}.conf";
file_put_contents($fpath, $conf);
unset($conf);
+ $fpath = "{$g['varetc_path']}/openvpn/{$mode_id}.interface";
+ file_put_contents($fpath, $interface);
//chown($fpath, 'nobody');
//chgrp($fpath, 'nobody');
@chmod("{$g['varetc_path']}/openvpn/{$mode_id}.conf", 0600);
+ @chmod("{$g['varetc_path']}/openvpn/{$mode_id}.interface", 0600);
@chmod("{$g['varetc_path']}/openvpn/{$mode_id}.key", 0600);
@chmod("{$g['varetc_path']}/openvpn/{$mode_id}.tls-auth", 0600);
@chmod("{$g['varetc_path']}/openvpn/{$mode_id}.conf", 0600);
OpenPOWER on IntegriCloud