diff --git a/modules/net_recon.go b/modules/net_recon.go index 93887c83..8bee565a 100644 --- a/modules/net_recon.go +++ b/modules/net_recon.go @@ -116,7 +116,7 @@ func (d *Discovery) runDiff() { // now check for new friends ^_^ for ip, mac := range d.current { - d.Session.Targets.AddIfNotExist(ip, mac) + d.Session.Targets.AddIfNew(ip, mac) } } diff --git a/session/session.go b/session/session.go index d435af43..c1bf237f 100644 --- a/session/session.go +++ b/session/session.go @@ -275,7 +275,7 @@ func (s *Session) Start() error { addr := event.IP.String() mac := event.MAC.String() - existing := s.Targets.AddIfNotExist(addr, mac) + existing := s.Targets.AddIfNew(addr, mac) if existing != nil { existing.LastSeen = time.Now() } diff --git a/session/targets.go b/session/targets.go index bccb8e2e..2d193999 100644 --- a/session/targets.go +++ b/session/targets.go @@ -153,7 +153,7 @@ func (tp *Targets) Has(ip string) bool { return false } -func (tp *Targets) AddIfNotExist(ip, mac string) *net.Endpoint { +func (tp *Targets) AddIfNew(ip, mac string) *net.Endpoint { tp.Lock() defer tp.Unlock()