summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/etc/inc/vpn.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc
index 4265004..bca533e 100644
--- a/src/etc/inc/vpn.inc
+++ b/src/etc/inc/vpn.inc
@@ -152,6 +152,8 @@ function vpn_ipsec_convert_to_modp($index) {
function vpn_ipsec_configure($restart = false) {
global $config, $g, $sa, $sn, $p1_ealgos, $p2_ealgos, $ipsec_idhandling;
+ $ipsecstartlock = lock('ipsec', LOCK_EX);
+
/* get the automatic ping_hosts.sh ready */
unlink_if_exists("{$g['vardb_path']}/ipsecpinghosts");
touch("{$g['vardb_path']}/ipsecpinghosts");
@@ -174,6 +176,7 @@ function vpn_ipsec_configure($restart = false) {
/* IPSEC is off, shutdown enc interface.*/
mwexec("/sbin/ifconfig enc0 down");
+ unlock($ipsecstartlock);
return 0;
}
@@ -1495,6 +1498,7 @@ EOD;
echo "done\n";
}
+ unlock($ipsecstartlock);
return count($filterdns_list);
}
OpenPOWER on IntegriCloud