summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets
diff options
context:
space:
mode:
authorErmal LUÇI <eri@pfsense.org>2015-01-09 23:12:21 +0100
committerErmal LUÇI <eri@pfsense.org>2015-01-09 23:12:21 +0100
commit9c0ec56ea8a978213a173dfcbbfe502e7e4a5084 (patch)
tree392cbc0040033526cb2fca408364372269e2c8d8 /usr/local/www/widgets
parent7f48765aab116dbc0549166c97373e4b6319ad66 (diff)
downloadpfsense-9c0ec56ea8a978213a173dfcbbfe502e7e4a5084.zip
pfsense-9c0ec56ea8a978213a173dfcbbfe502e7e4a5084.tar.gz
Do not count twice the phase2 entries
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r--usr/local/www/widgets/widgets/ipsec.widget.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr/local/www/widgets/widgets/ipsec.widget.php b/usr/local/www/widgets/widgets/ipsec.widget.php
index 43add04..8085d09 100644
--- a/usr/local/www/widgets/widgets/ipsec.widget.php
+++ b/usr/local/www/widgets/widgets/ipsec.widget.php
@@ -67,31 +67,35 @@ if (isset($config['ipsec']['phase1'])) { ?>
$ipsec_status['query']['ikesalist']['ikesa'] = array();
$ipsec_detail_array = array();
- $ikev1num = array();
+ $ikenum = array();
if (isset($config['ipsec']['phase2'])) {
foreach ($config['ipsec']['phase2'] as $ph2ent) {
if (!ipsec_lookup_phase1($ph2ent,$ph1ent))
continue;
- if ($ph2ent['remoteid']['type'] == "mobile" || isset($ph1ent['mobile'])))
+ if ($ph2ent['remoteid']['type'] == "mobile" || isset($ph1ent['mobile']))
continue;
if (isset($ph1ent['disabled']) || isset($ph2ent['disabled']))
continue;
if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == 'ikev1') {
if (!isset($ikev1num[$ph1ent['ikeid']]))
- $ikev1num[$ph1ent['ikeid']] = 0;
+ $ikenum[$ph1ent['ikeid']] = 0;
else
- $ikev1num[$ph1ent['ikeid']]++;
+ $ikenum[$ph1ent['ikeid']]++;
$ikeid = "con{$ph1ent['ikeid']}00" . $ikev1num[$ph1ent['ikeid']];
- } else
+ } else {
+ if (isset($ikenum[$ph1ent['ikeid']]))
+ continue;
$ikeid = "con{$ph1ent['ikeid']}";
+ $ikenum[$ph1ent['ikeid']] = true;
+ }
$found = false;
foreach ($ipsec_status['query']['ikesalist']['ikesa'] as $ikesa) {
if ($ikeid == $ikesa['peerconfig']) {
$found = true;
- if (ipsec_phase1_status($ipsec_status['query']['ikesalist']['ikesa'], $ikesa['id'])) {
+ if ($ikesa['status'] == 'established') {
/* tunnel is up */
$iconfn = "true";
$activecounter++;
OpenPOWER on IntegriCloud