From 3f0d07a67224d886a8ab8fd731e634e65b94eca1 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Wed, 2 Mar 2011 10:13:56 +0100 Subject: [PATCH] [Listener] Drop packets emitted by ourselves --- infrastructure-centred/owlps-listener/owlps-listenerd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/infrastructure-centred/owlps-listener/owlps-listenerd.c b/infrastructure-centred/owlps-listener/owlps-listenerd.c index c9256e4..2d70c3c 100644 --- a/infrastructure-centred/owlps-listener/owlps-listenerd.c +++ b/infrastructure-centred/owlps-listener/owlps-listenerd.c @@ -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):