net_buffer: prevent modules from messing with metadata too much

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21211 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Hugo Santos
2007-05-23 03:48:57 +00:00
parent 79a0d25245
commit d3d38faf41
5 changed files with 15 additions and 5 deletions
@@ -17,6 +17,7 @@
#include <KernelExport.h>
#include <util/AutoLock.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
@@ -1174,6 +1175,13 @@ count_iovecs(net_buffer *_buffer)
}
static void
swap_addresses(net_buffer *buffer)
{
std::swap(buffer->source, buffer->destination);
}
status_t
init_net_buffers()
{
@@ -1257,6 +1265,8 @@ net_buffer_module_info gNetBufferModule = {
get_iovecs,
count_iovecs,
swap_addresses,
dump_buffer, // dump
};