fix: one beacon packet per handshake is saved in order to have both the ESSID and BSSID

This commit is contained in:
evilsocket 2019-02-06 07:08:01 +01:00
commit 1120f98be1
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 28 additions and 4 deletions

View file

@ -129,7 +129,7 @@ func isBogusMacESSID(essid string) bool {
return false
}
func (w *WiFi) AddIfNew(ssid, mac string, frequency int, rssi int8) *AccessPoint {
func (w *WiFi) AddIfNew(ssid, mac string, frequency int, rssi int8) (*AccessPoint, bool) {
w.Lock()
defer w.Unlock()
@ -141,7 +141,7 @@ func (w *WiFi) AddIfNew(ssid, mac string, frequency int, rssi int8) *AccessPoint
if !isBogusMacESSID(ssid) {
ap.Hostname = ssid
}
return ap
return ap, false
}
newAp := NewAccessPoint(ssid, mac, frequency, rssi)
@ -151,7 +151,7 @@ func (w *WiFi) AddIfNew(ssid, mac string, frequency int, rssi int8) *AccessPoint
w.newCb(newAp)
}
return nil
return newAp, true
}
func (w *WiFi) Get(mac string) (*AccessPoint, bool) {