summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/vpn.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/inc/vpn.inc')
-rw-r--r--src/etc/inc/vpn.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc
index 09f514b..8769ca1 100644
--- a/src/etc/inc/vpn.inc
+++ b/src/etc/inc/vpn.inc
@@ -138,6 +138,7 @@ function vpn_ipsec_configure($restart = false) {
/* get the automatic ping_hosts.sh ready */
unlink_if_exists("{$g['vardb_path']}/ipsecpinghosts");
touch("{$g['vardb_path']}/ipsecpinghosts");
+ $ipsecpinghostsactive = false;
/* service may have been enabled, disabled, or otherwise changed in a way requiring rule updates */
filter_configure();
@@ -386,6 +387,7 @@ function vpn_ipsec_configure($restart = false) {
}
if (is_ipaddr($srcip)) {
$ipsecpinghosts[] = "{$srcip}|{$dstip}|3|||||{$family}|\n";
+ $ipsecpinghostsactive = true;
}
}
}
@@ -1221,7 +1223,8 @@ EOD;
$tunneltype = "type = transport";
if ((($ph1ent['authentication_method'] == "xauth_psk_server") ||
- ($ph1ent['authentication_method'] == "pre_shared_key")) && isset($ph1ent['mobile'])) {
+ ($ph1ent['authentication_method'] == "pre_shared_key")) &&
+ isset($ph1ent['mobile'])) {
$left_spec = "%any";
} else {
$tmpsubnet = ipsec_get_phase1_src($ph1ent);
@@ -1437,6 +1440,11 @@ EOD;
}
}
+ // run ping_hosts.sh once if it's enabled to avoid wait for minicron
+ if ($ipsecpinghostsactive == true) {
+ mwexec_bg("/usr/local/bin/ping_hosts.sh");
+ }
+
if ($natfilterrules == true) {
filter_configure();
}
OpenPOWER on IntegriCloud