From 7135473d191bfc0e7d36d0c28a8a8ef5b562c0dc Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Sat, 30 Aug 2014 23:02:41 -0300 Subject: [PATCH] Fixed bug triggered on Dot3 serialization. In addition, Dot3 now always sets the packet length on serialization. --- src/dot3.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/dot3.cpp b/src/dot3.cpp index b7580d5..9fcf4fa 100644 --- a/src/dot3.cpp +++ b/src/dot3.cpp @@ -127,18 +127,12 @@ bool Dot3::matches_response(const uint8_t *ptr, uint32_t total_sz) const { } void Dot3::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *parent) { - bool set_length = _eth.length == 0; #ifdef TINS_DEBUG assert(total_sz >= header_size()); #endif - - if (set_length) - _eth.length = Endian::host_to_be(size() - sizeof(_eth)); + _eth.length = Endian::host_to_be(size() - sizeof(_eth)); memcpy(buffer, &_eth, sizeof(ethhdr)); - - if (set_length) - _eth.length = 0; } #ifndef WIN32