From 9f24800e6d092e8f670464e571af45ac05c762f5 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Fri, 22 Mar 2019 15:11:07 +0100 Subject: [PATCH] fix: wifi clients sent and received data frame counters are now updated correctly --- modules/wifi/wifi.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/wifi/wifi.go b/modules/wifi/wifi.go index 50b17ed9..2007aa62 100644 --- a/modules/wifi/wifi.go +++ b/modules/wifi/wifi.go @@ -495,13 +495,17 @@ func (mod *WiFiModule) updateStats(dot11 *layers.Dot11, packet gopacket.Packet) bytes := uint64(len(packet.Data())) dst := dot11.Address1.String() - if station, found := mod.Session.WiFi.Get(dst); found { - station.Received += bytes + if ap, found := mod.Session.WiFi.Get(dst); found { + ap.Received += bytes + } else if sta, found := mod.Session.WiFi.GetClient(dst); found { + sta.Received += bytes } src := dot11.Address2.String() - if station, found := mod.Session.WiFi.Get(src); found { - station.Sent += bytes + if ap, found := mod.Session.WiFi.Get(src); found { + ap.Sent += bytes + } else if sta, found := mod.Session.WiFi.GetClient(src); found { + sta.Sent += bytes } } }