mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fixes
This commit is contained in:
parent
6b89145e80
commit
1ee605d01d
2 changed files with 20 additions and 9 deletions
|
@ -56,22 +56,23 @@ func (tp *Targets) Has(ip string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (tp *Targets) AddIfNotExist(ip, mac string) {
|
||||
func (tp *Targets) AddIfNotExist(ip, mac string) *net.Endpoint {
|
||||
tp.lock.Lock()
|
||||
defer tp.lock.Unlock()
|
||||
|
||||
if tp.shouldIgnore(ip) {
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
if t, found := tp.Targets[mac]; found {
|
||||
t.IpAddress = ip
|
||||
return
|
||||
return t
|
||||
}
|
||||
|
||||
e := net.NewEndpoint(ip, mac)
|
||||
log.Infof("[%snew%s] %s\n", core.GREEN, core.RESET, e)
|
||||
tp.Targets[mac] = e
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type tSorter []*net.Endpoint
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue