Skip to content

Commit c8b08ba

Browse files
committed
Sort packets by app layer, id, then direction
1 parent 728b03e commit c8b08ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

controllers/Packet/Index.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ public function run(Router &$router) {
4141
if ($a1 == $b1) {
4242
$a2 = $a->getPacketId();
4343
$b2 = $b->getPacketId();
44-
if ($a2 == $b2) return 0;
44+
if ($a2 == $b2) {
45+
$a3 = $a->getPacketDirectionId();
46+
$b3 = $b->getPacketDirectionId();
47+
if ($a3 == $b3) return 0;
48+
return ($a3 < $a3 ? -1 : 1);
49+
}
4550
return ($a2 < $b2 ? -1 : 1);
4651
}
4752
return ($a1 < $b1 ? -1 : 1);

0 commit comments

Comments
 (0)