summaryrefslogtreecommitdiffstats
path: root/usr/local
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:30 +0100
commit422a2007d59ad58e57621210749a31e55af99abb (patch)
tree6a7b38ab5a087560b4e3f92d04fe01d67f501898 /usr/local
parent832ec9fee947bc195b5ddd14f5ba91045789c81d (diff)
downloadpfsense-422a2007d59ad58e57621210749a31e55af99abb.zip
pfsense-422a2007d59ad58e57621210749a31e55af99abb.tar.gz
Do not count twice the phase2 entries
Diffstat (limited to 'usr/local')
-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