fix: fixed a bug which caused AP RSSI being 0 when fake association frames were sent

This commit is contained in:
evilsocket 2019-02-11 14:29:30 +01:00
parent 5315784f8a
commit c55aed1ca2
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -136,7 +136,9 @@ func (w *WiFi) AddIfNew(ssid, mac string, frequency int, rssi int8) (*AccessPoin
mac = NormalizeMac(mac)
if ap, found := w.aps[mac]; found {
ap.LastSeen = time.Now()
if rssi != 0 {
ap.RSSI = rssi
}
// always get the cleanest one
if !isBogusMacESSID(ssid) {
ap.Hostname = ssid