From e0d6de76a2ac38f0a65497b17874d737c202c367 Mon Sep 17 00:00:00 2001 From: Philipp Meyer Date: Wed, 8 Nov 2023 11:08:11 +0100 Subject: [PATCH] Fix merging of two ByteCountChunks with different data --- src/inet/common/packet/chunk/ByteCountChunk.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inet/common/packet/chunk/ByteCountChunk.cc b/src/inet/common/packet/chunk/ByteCountChunk.cc index cc151db6829..bb9fdcdb5ce 100644 --- a/src/inet/common/packet/chunk/ByteCountChunk.cc +++ b/src/inet/common/packet/chunk/ByteCountChunk.cc @@ -107,17 +107,17 @@ bool ByteCountChunk::containsSameData(const Chunk& other) const bool ByteCountChunk::canInsertAtFront(const Ptr& chunk) const { - return chunk->getChunkType() == CT_BYTECOUNT; + return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast(chunk)->data; } bool ByteCountChunk::canInsertAtBack(const Ptr& chunk) const { - return chunk->getChunkType() == CT_BYTECOUNT; + return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast(chunk)->data; } bool ByteCountChunk::canInsertAt(const Ptr& chunk, b offset) const { - return chunk->getChunkType() == CT_BYTECOUNT; + return chunk->getChunkType() == CT_BYTECOUNT && this->data == staticPtrCast(chunk)->data; } void ByteCountChunk::doInsertAtFront(const Ptr& chunk)