diff options
author | pdw <> | 2011-10-04 18:30:59 +0000 |
---|---|---|
committer | pdw <> | 2011-10-04 18:30:59 +0000 |
commit | 093c15f72f46913f0a5e168dcd4690aeee635d01 (patch) | |
tree | f10656d94a00da8f546042604e1f3ac8072cf0fc | |
parent | ac177644c3dc3a08cc2e17e7555781f886be42f4 (diff) | |
download | iftop-093c15f72f46913f0a5e168dcd4690aeee635d01.zip |
Increased capture length and adjusted 802.11 header length for radiotap
support.
-rw-r--r-- | ether.h | 2 | ||||
-rw-r--r-- | iftop.c | 9 |
2 files changed, 6 insertions, 5 deletions
@@ -28,6 +28,6 @@ struct radiotap_header { u_int8_t it_pad; u_int16_t it_len; /* entire length */ u_int32_t it_present; /* fields present */ -}; +} __attribute__((packed)); #endif @@ -86,9 +86,10 @@ static void finish(int sig) { * bytes of tcp/udp header */ /* Increase with a further 20 to account for IPv6 header length. */ /* IEEE 802.11 radiotap throws in a variable length header plus 8 (radiotap - * header header) plus 30 (802.11 MAC) plus 40 (IPv6) = 78, plus whatever's in + * header header) plus 34 (802.11 MAC) plus 40 (IPv6) = 78, plus whatever's in * the radiotap payload */ -#define CAPTURE_LENGTH 92 +/*#define CAPTURE_LENGTH 92 */ +#define CAPTURE_LENGTH 256 void init_history() { history = addr_hash_create(); @@ -612,9 +613,9 @@ static void handle_eth_packet(unsigned char* args, const struct pcap_pkthdr* pkt */ static void handle_radiotap_packet(unsigned char* args, const struct pcap_pkthdr* pkthdr, const unsigned char* packet) { - /* 802.11 MAC header is = 30 bytes */ + /* 802.11 MAC header is = 34 bytes (not sure if that's universally true) */ /* We could try harder to figure out hardware direction from the MAC header */ - handle_ip_packet((struct ip*)(packet + ((struct radiotap_header *)packet)->it_len + 30),-1); + handle_ip_packet((struct ip*)(packet + ((struct radiotap_header *)packet)->it_len + 34),-1); } |