From 8afe3d7429d6dde9c0d1564b3855cff45355a0ae Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Tue, 23 Aug 2011 12:04:15 -0300 Subject: [PATCH] Fixed RadioTap FCS flag check. --- src/radiotap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/radiotap.cpp b/src/radiotap.cpp index a1826e0..46e6b13 100644 --- a/src/radiotap.cpp +++ b/src/radiotap.cpp @@ -112,7 +112,7 @@ uint32_t Tins::RadioTap::header_size() const { uint32_t Tins::RadioTap::trailer_size() const { // will be sizeof(uint32_t) if the FCS-at-the-end bit is on. - return ((_radio.flags & 0x10) == 1) ? sizeof(uint32_t) : 0; + return ((_flags & 0x10) != 0) ? sizeof(uint32_t) : 0; } bool Tins::RadioTap::send(PacketSender* sender) { @@ -174,6 +174,6 @@ void Tins::RadioTap::write_serialization(uint8_t *buffer, uint32_t total_sz, con memcpy(buffer, &_rx_flags, sizeof(_rx_flags)); buffer += sizeof(_rx_flags); } - if((_radio.flags & 0x10) == 1 && inner_pdu()) + if((_flags & 0x10) != 0 && inner_pdu()) *(uint32_t*)(buffer + inner_pdu()->size()) = Utils::crc32(buffer, inner_pdu()->size()); }