[Listener] Drop packets emitted by ourselves

This commit is contained in:
Matteo Cypriani 2011-03-02 10:13:56 +01:00
parent a4d001c4fb
commit 3f0d07a672
1 changed files with 6 additions and 1 deletions

View File

@ -622,9 +622,14 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
printf("This packet is a Retry.\n") ;
#endif // DEBUG
memcpy(couple.ap_mac_addr_bytes, my_mac, 6) ; // Copy AP MAC
// Source MAC address is 10 bytes after the 802.11 packet type:
memcpy(couple.mobile_mac_addr_bytes, &data[rtap_bytes+10], 6) ;
// Drop the packet if it comes from the AP itself:
if (mac_cmp(my_mac, couple.mobile_mac_addr_bytes))
return ;
memcpy(couple.ap_mac_addr_bytes, my_mac, 6) ; // Copy AP MAC
couple.start_time = header->ts ; // Capture time is in the pcap header
// Transmission time on the mobile is unknown (unless the packet is
// an explicit request):