summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-08-25 21:15:49 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-08-25 21:15:49 -0400
commitd86d411a92fe9499b8e653f4621795e30405d1da (patch)
treebc462ba606504e4ea634313f2f5a9352ebf04f05
parent66058d00d050f7e709e1058efa477f0603081adc (diff)
downloadpfsense-d86d411a92fe9499b8e653f4621795e30405d1da.zip
pfsense-d86d411a92fe9499b8e653f4621795e30405d1da.tar.gz
Do not enter for loop if all variables are 0. Apparently we have some include ordering issues that are preventing these variables from being set.
-rw-r--r--etc/inc/vpn.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index b1620c4..1bfa78d 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -641,11 +641,15 @@ EOD;
$key_hi = $p2_ealgos[$ealg_id]['keysel']['hi'];
$key_lo = $p2_ealgos[$ealg_id]['keysel']['lo'];
$key_step = $p2_ealgos[$ealg_id]['keysel']['step'];
-
- for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step) {
- if ($ealgos)
- $ealgos = $ealgos.", ";
- $ealgos = $ealgos.$ealg_id." ".$keylen;
+ /* in some cases where include ordering is suspect these variables
+ are somehow 0 and we enter this loop forever and timeout after 900
+ seconds wrecking bootup */
+ if($keylen !=0 and $key_hi != 0 and $key_step !=0) {
+ for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step) {
+ if ($ealgos)
+ $ealgos = $ealgos.", ";
+ $ealgos = $ealgos.$ealg_id." ".$keylen;
+ }
}
} else {
if ($ealgos)
OpenPOWER on IntegriCloud