1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 20:24:26 +01:00

Fixed a bug in PPI and Dot1Q triggered when constructing from buffer/serializing. Done some documentation fixes.

This commit is contained in:
Matias Fontanini
2013-09-22 19:37:02 -03:00
parent 74ef177e25
commit 2414edd1e7
10 changed files with 243 additions and 96 deletions

View File

@@ -72,7 +72,7 @@ RadioTap::RadioTap(const uint8_t *buffer, uint32_t total_sz)
check_size(total_sz, sizeof(_radio));
const uint8_t *buffer_start = buffer;
std::memcpy(&_radio, buffer, sizeof(_radio));
uint32_t radiotap_hdr_size = Endian::le_to_host(_radio.it_len);
uint32_t radiotap_hdr_size = length();
check_size(total_sz, radiotap_hdr_size);
buffer += sizeof(_radio);
radiotap_hdr_size -= sizeof(_radio);
@@ -132,14 +132,14 @@ RadioTap::RadioTap(const uint8_t *buffer, uint32_t total_sz)
read_field(buffer, radiotap_hdr_size, _max_power);
}
total_sz -= Endian::le_to_host(_radio.it_len);
total_sz -= length();
buffer += radiotap_hdr_size;
if(_radio.flags && (flags() & FCS) != 0) {
check_size(total_sz, sizeof(uint32_t));
total_sz -= sizeof(uint32_t);
if((flags() & FAILED_FCS) !=0)
throw malformed_packet();
throw malformed_packet();
}
if(total_sz)