summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2015-07-30 00:37:48 -0500
committerChris Buechler <cmb@pfsense.org>2015-07-30 00:37:48 -0500
commitfcf8ac0ab71b6adad068f20f83fe5564d25e9073 (patch)
tree3f53242dd3eaf43f3a48ec82bb25a3a562a6e085
parentffb3d9d53a7eb87af889e17f6626c9df72ddd0cc (diff)
downloadpfsense-fcf8ac0ab71b6adad068f20f83fe5564d25e9073.zip
pfsense-fcf8ac0ab71b6adad068f20f83fe5564d25e9073.tar.gz
Fix killing of individual states for IPv6. Ticket #4906
-rwxr-xr-xusr/local/www/diag_dump_states.php38
1 files changed, 27 insertions, 11 deletions
diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php
index beb2bce..6bf3f8f 100755
--- a/usr/local/www/diag_dump_states.php
+++ b/usr/local/www/diag_dump_states.php
@@ -195,19 +195,35 @@ while ($line = chop(fgets($fd))) {
/* break up info and extract $srcip and $dstip */
$ends = preg_split("/\<?-\>?/", $info);
- $parts = explode(":", $ends[0]);
- if (strstr($info, "->")) {
- $srcip = trim($parts[0]);
- } else {
- $dstip = trim($parts[0]);
- }
- $parts = explode(":", $ends[count($ends) - 1]);
- if (strstr($info, "->")) {
- $dstip = trim($parts[0]);
+ if (strstr($info, "[")) {
+ // IPv6
+ $parts = explode("[", $ends[0]);
+ if (strstr($info, "->")) {
+ $srcip = trim($parts[0]);
+ } else {
+ $dstip = trim($parts[0]);
+ }
+ $parts = explode("[", $ends[count($ends) - 1]);
+ if (strstr($info, "->")) {
+ $dstip = trim($parts[0]);
+ } else {
+ $srcip = trim($parts[0]);
+ }
} else {
- $srcip = trim($parts[0]);
+ // IPv4
+ $parts = explode(":", $ends[0]);
+ if (strstr($info, "->")) {
+ $srcip = trim($parts[0]);
+ } else {
+ $dstip = trim($parts[0]);
+ }
+ $parts = explode(":", $ends[count($ends) - 1]);
+ if (strstr($info, "->")) {
+ $dstip = trim($parts[0]);
+ } else {
+ $srcip = trim($parts[0]);
+ }
}
-
?>
<tr valign="top" id="r:<?= $srcip ?>:<?= $dstip ?>">
<td class="listlr"><?= $iface ?></td>
OpenPOWER on IntegriCloud