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:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user