Skip to content

Commit

Permalink
Fix merging of two ByteCountChunks with different data
Browse files Browse the repository at this point in the history
  • Loading branch information
Musteblume authored and levy committed Nov 8, 2023
1 parent a97d940 commit e0d6de7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/inet/common/packet/chunk/ByteCountChunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ bool ByteCountChunk::containsSameData(const Chunk& other) const

bool ByteCountChunk::canInsertAtFront(const Ptr<const Chunk>& chunk) const
{
return chunk->getChunkType() == CT_BYTECOUNT;
return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast<const ByteCountChunk>(chunk)->data;
}

bool ByteCountChunk::canInsertAtBack(const Ptr<const Chunk>& chunk) const
{
return chunk->getChunkType() == CT_BYTECOUNT;
return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast<const ByteCountChunk>(chunk)->data;
}

bool ByteCountChunk::canInsertAt(const Ptr<const Chunk>& chunk, b offset) const
{
return chunk->getChunkType() == CT_BYTECOUNT;
return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast<const ByteCountChunk>(chunk)->data;
}

void ByteCountChunk::doInsertAtFront(const Ptr<const Chunk>& chunk)
Expand Down

0 comments on commit e0d6de7

Please sign in to comment.