From 82ea06cb5e76b6cdb761e68c61cec23ccd5b956b Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Thu, 14 Apr 2016 21:30:54 -0500 Subject: Add lock in vpn_ipsec_configure. Ticket #6160 --- src/etc/inc/vpn.inc | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- cgit v1.1