diff options
author | Chris Buechler <cmb@pfsense.org> | 2015-07-30 00:37:48 -0500 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2015-07-30 00:37:48 -0500 |
commit | fcf8ac0ab71b6adad068f20f83fe5564d25e9073 (patch) | |
tree | 3f53242dd3eaf43f3a48ec82bb25a3a562a6e085 | |
parent | ffb3d9d53a7eb87af889e17f6626c9df72ddd0cc (diff) | |
download | pfsense-fcf8ac0ab71b6adad068f20f83fe5564d25e9073.zip pfsense-fcf8ac0ab71b6adad068f20f83fe5564d25e9073.tar.gz |
Fix killing of individual states for IPv6. Ticket #4906
-rwxr-xr-x | usr/local/www/diag_dump_states.php | 38 |
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> |