mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
c901cf31d5
commit
c2cd198d37
3 changed files with 21 additions and 32 deletions
|
@ -52,18 +52,6 @@ func (p Prober) Author() string {
|
|||
return "Simone Margaritelli <evilsocket@protonmail.com>"
|
||||
}
|
||||
|
||||
func (p *Prober) shouldProbe(ip net.IP) bool {
|
||||
addr := ip.String()
|
||||
if ip.IsLoopback() == true {
|
||||
return false
|
||||
} else if addr == p.Session.Interface.IpAddress {
|
||||
return false
|
||||
} else if addr == p.Session.Gateway.IpAddress {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *Prober) sendProbe(from net.IP, from_hw net.HardwareAddr, ip net.IP) {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
|
@ -103,7 +91,7 @@ func (p *Prober) Start() error {
|
|||
|
||||
for p.Running() {
|
||||
for _, ip := range addresses {
|
||||
if p.shouldProbe(ip) == false {
|
||||
if p.Session.Skip(ip) == true {
|
||||
log.Debug("Skipping address %s from UDP probing.", ip)
|
||||
continue
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue