fix: wifi clients sent and received data frame counters are now updated correctly

This commit is contained in:
evilsocket 2019-03-22 15:11:07 +01:00
commit 9f24800e6d
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -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
}
}
}