mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
fix: wifi clients sent and received data frame counters are now updated correctly
This commit is contained in:
parent
7e7f2ef645
commit
9f24800e6d
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue