All radiotap header fields are specified in little endian byte-order. Header length conversion is necessary on some platforms.
Signed-off-by: Marek Lindner mareklindner@neomailbox.ch --- tcpdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tcpdump.c b/tcpdump.c index 4b9e4f6..1beace1 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -1144,10 +1144,10 @@ static int monitor_header_length(unsigned char *packet_buff, ssize_t buff_len, i return -1;
radiotap_hdr = (struct radiotap_header*)packet_buff; - if (buff_len <= radiotap_hdr->it_len) + if (buff_len <= le16toh(radiotap_hdr->it_len)) return -1; else - return radiotap_hdr->it_len; + return le16toh(radiotap_hdr->it_len); }
return -1;