Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4504 → Rev 4505

/branches/network/uspace/srv/net/structures/packet/packet_client.c
34,16 → 34,13
* Packet client implementation.
*/
 
#include <async.h>
#include <errno.h>
#include <mem.h>
#include <unistd.h>
//#include <stdio.h>
 
#include <ipc/ipc.h>
#include <sys/mman.h>
 
#include "../../err.h"
#include "../../messages.h"
 
#include "packet.h"
61,7 → 58,7
}
 
void * packet_prefix( packet_t packet, size_t length ){
if(( ! packet_is_valid( packet )) || ( packet->data_start - sizeof( struct packet ) - 2 * packet->addr_len < length )) return NULL;
if(( ! packet_is_valid( packet )) || ( packet->data_start - sizeof( struct packet ) - 2 * ( packet->dest_addr - packet->src_addr ) < length )) return NULL;
packet->data_start -= length;
return ( void * ) packet + packet->data_start;
}