summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-02 14:58:15 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-02 14:58:15 -0300
commit060c3ac00b71131c08ad1a88033b14546bb6b53b (patch)
treee7acee7d22fef2b09e02ec5183a7d874e16f4065
parent55d6f48bc8f5b24f0756e52a121b26c2a57fe186 (diff)
downloadpfsense-060c3ac00b71131c08ad1a88033b14546bb6b53b.zip
pfsense-060c3ac00b71131c08ad1a88033b14546bb6b53b.tar.gz
Fix subnet display for IPsec status. Ticket #3826
-rw-r--r--etc/inc/ipsec.inc16
-rw-r--r--usr/local/www/diag_ipsec.php4
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";
OpenPOWER on IntegriCloud