mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Simplify reassembly code using DataBlockList::LastBlock()
This commit is contained in:
parent
5ce68bd20a
commit
1253a61340
5 changed files with 15 additions and 6 deletions
9
CHANGES
9
CHANGES
|
@ -1,4 +1,13 @@
|
||||||
|
|
||||||
|
3.1.0-dev.143 | 2019-09-24 10:23:24 -0700
|
||||||
|
|
||||||
|
* Simplify reassembly code using DataBlockList::LastBlock() (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
* Fix DataBlockList::DataSize() (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
Parameters got filled opposite to what they were supposed to be and
|
||||||
|
also didn't consider cutoffs that land in the middle of a block.
|
||||||
|
|
||||||
3.1.0-dev.141 | 2019-09-24 10:31:50 +0000
|
3.1.0-dev.141 | 2019-09-24 10:31:50 +0000
|
||||||
|
|
||||||
* Reorganize reassembly data structures. This replaces the previous
|
* Reorganize reassembly data structures. This replaces the previous
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.1.0-dev.141
|
3.1.0-dev.143
|
||||||
|
|
|
@ -205,7 +205,7 @@ void FragReassembler::BlockInserted(DataBlockMap::const_iterator /* it */)
|
||||||
++next;
|
++next;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& last = std::prev(block_list.End())->second;
|
const auto& last = block_list.LastBlock();
|
||||||
|
|
||||||
if ( next != block_list.End() )
|
if ( next != block_list.End() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,7 +68,7 @@ void TCP_Reassembler::Done()
|
||||||
{ // Record any undelivered data.
|
{ // Record any undelivered data.
|
||||||
if ( ! block_list.Empty() )
|
if ( ! block_list.Empty() )
|
||||||
{
|
{
|
||||||
auto last_block = std::prev(block_list.End())->second;
|
const auto& last_block = block_list.LastBlock();
|
||||||
|
|
||||||
if ( last_reassem_seq < last_block.upper )
|
if ( last_reassem_seq < last_block.upper )
|
||||||
RecordToSeq(last_reassem_seq, last_block.upper,
|
RecordToSeq(last_reassem_seq, last_block.upper,
|
||||||
|
@ -91,7 +91,7 @@ uint64_t TCP_Reassembler::NumUndeliveredBytes() const
|
||||||
if ( block_list.Empty() )
|
if ( block_list.Empty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto last_block = std::prev(block_list.End())->second;
|
const auto& last_block = block_list.LastBlock();
|
||||||
return last_block.upper - last_reassem_seq;
|
return last_block.upper - last_reassem_seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ void TCP_Reassembler::MatchUndelivered(uint64_t up_to_seq, bool use_last_upper)
|
||||||
if ( block_list.Empty() || ! rule_matcher )
|
if ( block_list.Empty() || ! rule_matcher )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& last_block = std::prev(block_list.End())->second;
|
const auto& last_block = block_list.LastBlock();
|
||||||
|
|
||||||
if ( use_last_upper )
|
if ( use_last_upper )
|
||||||
up_to_seq = last_block.upper;
|
up_to_seq = last_block.upper;
|
||||||
|
|
|
@ -29,7 +29,7 @@ uint64_t FileReassembler::Flush()
|
||||||
if ( block_list.Empty() )
|
if ( block_list.Empty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const auto& last_block = std::prev(block_list.End())->second;
|
const auto& last_block = block_list.LastBlock();
|
||||||
|
|
||||||
// This is expected to call back into FileReassembler::Undelivered().
|
// This is expected to call back into FileReassembler::Undelivered().
|
||||||
flushing = true;
|
flushing = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue