diff --git a/src/add-ons/kernel/network/protocols/icmp/icmp.cpp b/src/add-ons/kernel/network/protocols/icmp/icmp.cpp index 14f8959988..dee67029ee 100644 --- a/src/add-ons/kernel/network/protocols/icmp/icmp.cpp +++ b/src/add-ons/kernel/network/protocols/icmp/icmp.cpp @@ -27,12 +27,10 @@ #include #include -//#include - #include "ipv4.h" -#define TRACE_ICMP +//#define TRACE_ICMP #ifdef TRACE_ICMP # define TRACE(x...) dprintf(x) #else @@ -70,11 +68,6 @@ typedef NetBufferField ICMPChecksumField; -#define ICMP_TYPE_ECHO_REPLY 0 -#define ICMP_TYPE_UNREACH 3 -#define ICMP_TYPE_REDIRECT 5 -#define ICMP_TYPE_ECHO_REQUEST 8 - // type unreach codes #define ICMP_CODE_UNREACH_NEED_FRAGMENT 4 // this is used for path MTU discovery @@ -365,6 +358,7 @@ icmp_receive_data(net_buffer* buffer) if (error > 0) { // Deliver the error to the domain protocol which will // propagate the error to the upper protocols + bufferHeader.Remove(); return domain->module->error_received(error, buffer); } break; diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp index 88963875e3..55bc52a64d 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp @@ -733,7 +733,7 @@ raw_receive_data(net_buffer* buffer) // and lists for RAW and non-RAW sockets. return deliver_multicast(&gIPv4Module, buffer, true); } - + RawSocketList::Iterator iterator = sRawSockets.GetIterator(); size_t count = 0; @@ -1679,16 +1679,14 @@ ipv4_deliver_data(net_protocol* _protocol, net_buffer* buffer) status_t -ipv4_error_received(uint32 code, net_buffer* data) +ipv4_error_received(uint32 code, net_buffer* buffer) { - // Extracts the IP header in the ICMP message - NetBufferFieldReader header(data); - net_protocol_module_info* protocol = receiving_protocol(header->protocol); + net_protocol_module_info* protocol = receiving_protocol(buffer->protocol); if (protocol == NULL) return B_ERROR; // propagate error - return protocol->error_received(code, data); + return protocol->error_received(code, buffer); }