mirror of
https://github.com/bettercap/bettercap
synced 2025-07-31 12:10:10 -07:00
balls
This commit is contained in:
parent
73f887087a
commit
80bbd2a0a0
3 changed files with 3 additions and 3 deletions
|
@ -116,7 +116,7 @@ func (d *Discovery) runDiff() {
|
||||||
|
|
||||||
// now check for new friends ^_^
|
// now check for new friends ^_^
|
||||||
for ip, mac := range d.current {
|
for ip, mac := range d.current {
|
||||||
d.Session.Targets.AddIfNotExist(ip, mac)
|
d.Session.Targets.AddIfNew(ip, mac)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ func (s *Session) Start() error {
|
||||||
addr := event.IP.String()
|
addr := event.IP.String()
|
||||||
mac := event.MAC.String()
|
mac := event.MAC.String()
|
||||||
|
|
||||||
existing := s.Targets.AddIfNotExist(addr, mac)
|
existing := s.Targets.AddIfNew(addr, mac)
|
||||||
if existing != nil {
|
if existing != nil {
|
||||||
existing.LastSeen = time.Now()
|
existing.LastSeen = time.Now()
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ func (tp *Targets) Has(ip string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tp *Targets) AddIfNotExist(ip, mac string) *net.Endpoint {
|
func (tp *Targets) AddIfNew(ip, mac string) *net.Endpoint {
|
||||||
tp.Lock()
|
tp.Lock()
|
||||||
defer tp.Unlock()
|
defer tp.Unlock()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue