* Fixed build with tracing turned on.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35072 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
# define TRACE_SK(args...) do { } while (0)
|
# define TRACE_SK(args...) do { } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
struct ipv4_header {
|
struct ipv4_header {
|
||||||
#if B_HOST_IS_LENDIAN == 1
|
#if B_HOST_IS_LENDIAN == 1
|
||||||
uint8 header_length : 4; // header length in 32-bit words
|
uint8 header_length : 4; // header length in 32-bit words
|
||||||
@@ -408,7 +409,7 @@ FragmentPacket::Reassemble(net_buffer* to)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (buffer != to)
|
if (buffer != to)
|
||||||
panic("ipv4 packet reassembly did not work correctly.\n");
|
panic("ipv4 packet reassembly did not work correctly.");
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -628,9 +629,8 @@ send_fragments(ipv4_protocol* protocol, struct net_route* route,
|
|||||||
// this way)
|
// this way)
|
||||||
mtu -= headerLength;
|
mtu -= headerLength;
|
||||||
mtu &= ~7;
|
mtu &= ~7;
|
||||||
TRACE(" adjusted MTU to %ld\n", mtu);
|
TRACE(" adjusted MTU to %ld, bytesLeft %ld", mtu, bytesLeft);
|
||||||
|
|
||||||
TRACE(" bytesLeft = %ld\n", bytesLeft);
|
|
||||||
while (bytesLeft > 0) {
|
while (bytesLeft > 0) {
|
||||||
uint32 fragmentLength = min_c(bytesLeft, mtu);
|
uint32 fragmentLength = min_c(bytesLeft, mtu);
|
||||||
bytesLeft -= fragmentLength;
|
bytesLeft -= fragmentLength;
|
||||||
@@ -644,7 +644,8 @@ send_fragments(ipv4_protocol* protocol, struct net_route* route,
|
|||||||
headerLength);
|
headerLength);
|
||||||
// TODO: compute the checksum only for those parts that changed?
|
// TODO: compute the checksum only for those parts that changed?
|
||||||
|
|
||||||
TRACE(" send fragment of %ld bytes (%ld bytes left)\n", fragmentLength, bytesLeft);
|
TRACE(" send fragment of %ld bytes (%ld bytes left)", fragmentLength,
|
||||||
|
bytesLeft);
|
||||||
|
|
||||||
net_buffer* fragmentBuffer;
|
net_buffer* fragmentBuffer;
|
||||||
if (!lastFragment) {
|
if (!lastFragment) {
|
||||||
@@ -1422,7 +1423,7 @@ ipv4_send_routed_data(net_protocol* _protocol, struct net_route* route,
|
|||||||
gBufferModule->checksum(buffer, 0, sizeof(ipv4_header), true),
|
gBufferModule->checksum(buffer, 0, sizeof(ipv4_header), true),
|
||||||
gBufferModule->checksum(buffer, 0, buffer->size, true));
|
gBufferModule->checksum(buffer, 0, buffer->size, true));
|
||||||
|
|
||||||
TRACE_SK(protocol, " SendRoutedData(): destination: %08lx",
|
TRACE_SK(protocol, " SendRoutedData(): destination: %08x",
|
||||||
ntohl(destination.sin_addr.s_addr));
|
ntohl(destination.sin_addr.s_addr));
|
||||||
|
|
||||||
uint32 mtu = route->mtu ? route->mtu : interface->mtu;
|
uint32 mtu = route->mtu ? route->mtu : interface->mtu;
|
||||||
@@ -1580,7 +1581,7 @@ ipv4_receive_data(net_buffer* buffer)
|
|||||||
&buffer->interface, &matchedAddressType)
|
&buffer->interface, &matchedAddressType)
|
||||||
&& !sDatalinkModule->is_local_link_address(sDomain, true,
|
&& !sDatalinkModule->is_local_link_address(sDomain, true,
|
||||||
buffer->destination, &buffer->interface)) {
|
buffer->destination, &buffer->interface)) {
|
||||||
TRACE(" ReceiveData(): packet was not for us %lx -> %lx",
|
TRACE(" ReceiveData(): packet was not for us %x -> %x",
|
||||||
ntohl(header.source), ntohl(header.destination));
|
ntohl(header.source), ntohl(header.destination));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user