diff options
author | Renato Botelho <renato@netgate.com> | 2015-11-03 16:58:58 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-11-03 16:58:58 -0200 |
commit | d6d9144e203f6fc350b4c96dc49271553e121b02 (patch) | |
tree | 160ff150655ebbf4b467539c1f72f66454e9aa86 | |
parent | b31b713d683ecda6940fdba1bd0c4717bcdc0f21 (diff) | |
download | pfsense-d6d9144e203f6fc350b4c96dc49271553e121b02.zip pfsense-d6d9144e203f6fc350b4c96dc49271553e121b02.tar.gz |
Only call pfSense_ipsec_list_sa() when IPsec is enabled
-rw-r--r-- | etc/inc/ipsec.inc | 13 | ||||
-rw-r--r-- | usr/local/www/diag_ipsec.php | 2 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/ipsec.widget.php | 2 |
3 files changed, 15 insertions, 2 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index ec2b592..b60dd49 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -427,6 +427,19 @@ function ipsec_phase2_status(&$ipsec_status, &$phase2) { } /* + * Wrapper to call pfSense_ipsec_list_sa() when IPsec is enabled + */ +function ipsec_list_sa() { + global $config; + + if (isset($config['ipsec']['enable'])) { + return pfSense_ipsec_list_sa(); + } + + return array(); +} + +/* * Return dump of SPD table */ function ipsec_dump_spd() { diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 528dc4e..fd7c0db 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -114,7 +114,7 @@ if (!is_array($config['ipsec']['phase1'])) $a_phase1 = &$config['ipsec']['phase1']; -$status = pfSense_ipsec_list_sa(); +$status = ipsec_list_sa(); ?> diff --git a/usr/local/www/widgets/widgets/ipsec.widget.php b/usr/local/www/widgets/widgets/ipsec.widget.php index 2838cd0..5990125 100644 --- a/usr/local/www/widgets/widgets/ipsec.widget.php +++ b/usr/local/www/widgets/widgets/ipsec.widget.php @@ -51,7 +51,7 @@ if (isset($config['ipsec']['phase1'])) { ?> $spd = ipsec_dump_spd(); $sad = ipsec_dump_sad(); $mobile = ipsec_dump_mobile(); - $ipsec_status = pfSense_ipsec_list_sa(); + $ipsec_status = ipsec_list_sa(); $activecounter = 0; $inactivecounter = 0; |