[Listener] Fix reception timestamp

struct pcap_pkthdr.ts is host-endian, not net-endian, so we have to
convert it to net-endianess when reading it from the packet.
This commit is contained in:
Matteo Cypriani 2011-08-24 14:05:16 +02:00
parent 8bec37c4ad
commit 40bc6d0b59
1 changed files with 3 additions and 2 deletions

View File

@ -926,8 +926,9 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
// Copy AP MAC :
memcpy(request.ap_mac_addr_bytes, my_mac_bytes, ETHER_ADDR_LEN) ;
// Capture time is in the pcap header (net-endian):
request.start_time = owl_timeval_to_timestamp(header->ts) ;
// Capture time is in the pcap header (host-endian):
request.start_time =
owl_hton_timestamp(owl_timeval_to_timestamp(header->ts)) ;
/* Active mode */
if (is_explicit_packet