diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-09-02 14:58:15 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-09-02 14:58:15 -0300 |
commit | 060c3ac00b71131c08ad1a88033b14546bb6b53b (patch) | |
tree | e7acee7d22fef2b09e02ec5183a7d874e16f4065 | |
parent | 55d6f48bc8f5b24f0756e52a121b26c2a57fe186 (diff) | |
download | pfsense-060c3ac00b71131c08ad1a88033b14546bb6b53b.zip pfsense-060c3ac00b71131c08ad1a88033b14546bb6b53b.tar.gz |
Fix subnet display for IPsec status. Ticket #3826
-rw-r--r-- | etc/inc/ipsec.inc | 16 | ||||
-rw-r--r-- | usr/local/www/diag_ipsec.php | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index dd2f033..b55187f 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -742,4 +742,20 @@ function ipsec_find_id(& $ph1ent, $side = "local", $rgmap = array()) { } return array($thisid_type, $thisid_data); } + +function ipsec_fixup_network($network) { + if (substr($network, -3) == '|/0') + $result = substr($network, 0, -3); + else { + $tmp = explode('|', $network); + if (isset($tmp[1])) + $result = $tmp[1]; + else + $result = $tmp[0]; + unset($tmp); + } + + return $result; +} + ?> diff --git a/usr/local/www/diag_ipsec.php b/usr/local/www/diag_ipsec.php index 8667fb9..0bfb050 100644 --- a/usr/local/www/diag_ipsec.php +++ b/usr/local/www/diag_ipsec.php @@ -229,7 +229,7 @@ $status = ipsec_smp_dump_status(); <td class="listlr nowrap"> <?php if (is_array($childsa['local']) && is_array($childsa['local']['networks']) && is_array($childsa['local']['networks']['network'])) { foreach ($childsa['local']['networks']['network'] as $lnets) { - echo htmlspecialchars($lnets) . "<br />"; + echo htmlspecialchars(ipsec_fixup_network($lnets)) . "<br />"; } } else echo "Unknown"; @@ -248,7 +248,7 @@ $status = ipsec_smp_dump_status(); <td class="listr nowrap"> <?php if (is_array($childsa['remote']) && is_array($childsa['remote']['networks']) && is_array($childsa['remote']['networks']['network'])) { foreach ($childsa['remote']['networks']['network'] as $rnets) { - echo htmlspecialchars($rnets) . "<br />"; + echo htmlspecialchars(ipsec_fixup_network($rnets)) . "<br />"; } } else echo "Unknown"; |