Author: axeld Date: 2010-01-14 17:35:41 +0100 (Thu, 14 Jan 2010) New Revision: 35073 Changeset: http://dev.haiku-os.org/changeset/35073/haiku Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp Log: * copy_meta_data() also copied the size of the buffer, which wasn't such a good idea. Splitting large buffers no longer causes KDL. * merge_buffer() now maintains the size of the source buffer while removing its nodes. * The paranoia checks run through again now. Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2010-01-14 16:31:24 UTC (rev 35072) +++ haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2010-01-14 16:35:41 UTC (rev 35073) @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2010, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -7,6 +7,7 @@ * Ingo Weinhold, ingo_weinhold@xxxxxx */ + #include "utility.h" #include <net_buffer.h> @@ -1028,7 +1029,6 @@ destination->flags = source->flags; destination->interface = source->interface; destination->offset = source->offset; - destination->size = source->size; destination->protocol = source->protocol; destination->type = source->type; } @@ -1151,6 +1151,7 @@ copy_metadata(duplicate, buffer); + ASSERT(duplicate->size == buffer->size); CHECK_BUFFER(buffer); CHECK_BUFFER(duplicate); RUN_PARANOIA_CHECKS(duplicate); @@ -1189,6 +1190,7 @@ } copy_metadata(clone, buffer); + ASSERT(clone->size == buffer->size); return clone; @@ -1259,6 +1261,7 @@ copy_metadata(clone, buffer); + ASSERT(clone->size == buffer->size); CREATE_PARANOIA_CHECK_SET(clone, "net_buffer"); SET_PARANOIA_CHECK(PARANOIA_SUSPICIOUS, clone, &clone->size, sizeof(clone->size)); @@ -1363,6 +1366,7 @@ // The node is already in the buffer, we can just move it // over to the new owner list_remove_item(&with->buffers, node); + with->size -= node->used; } else { // we need a new place for this node data_node* newNode = add_data_node(buffer, node->header);