summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-11-11 22:18:00 (GMT)
committerErmal <eri@pfsense.org>2014-11-11 22:18:00 (GMT)
commit694d368d818508a40bdef4f1a3f64b414b11c442 (patch)
treee726daa0ff1f861bf5d0c8a514b48cf83567eaef
parentc7f5b55a28b71e25e85b94a25c81f02f893298b6 (diff)
downloadunivnautes-694d368d818508a40bdef4f1a3f64b414b11c442.zip
univnautes-694d368d818508a40bdef4f1a3f64b414b11c442.tar.gz
univnautes-694d368d818508a40bdef4f1a3f64b414b11c442.tar.bz2
Make phase1_status function wok whnever there is a smp dump. This should unbreak Ticket #3955
-rw-r--r--etc/inc/ipsec.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc
index 601f17d..874cbfd 100644
--- a/etc/inc/ipsec.inc
+++ b/etc/inc/ipsec.inc
@@ -346,8 +346,15 @@ function ipsec_lookup_phase1(& $ph2ent,& $ph1ent) {
*/
function ipsec_phase1_status($ipsec_status, $ikeid) {
- foreach ($ipsec_status as $ike) {
- if ($ike['id'] != $ikeid)
+ if (!is_array($ipsec_status['query']))
+ return false;
+ if (!is_array($ipsec_status['query']['ikesalist']))
+ return false;
+ if (!is_array($ipsec_status['query']['ikesalist']['ikesa']))
+ return false;
+
+ foreach ($ipsec_status['query']['ikesalist']['ikesa'] as $ike) {
+ if ($ike['id'] != "con{$ikeid}")
continue;
if ($ike['status'] == 'established')
return true;