mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
cd249687da
commit
df8ebd2525
1 changed files with 7 additions and 5 deletions
|
@ -113,11 +113,14 @@ func (mod *SynScanner) Author() string {
|
|||
func (mod *SynScanner) Configure() (err error) {
|
||||
if mod.Running() {
|
||||
return session.ErrAlreadyStarted(mod.Name())
|
||||
} else if mod.handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
|
||||
}
|
||||
if mod.handle == nil {
|
||||
if mod.handle, err = pcap.OpenLive(mod.Session.Interface.Name(), 65536, true, pcap.BlockForever); err != nil {
|
||||
return err
|
||||
} else if err = mod.handle.SetBPFFilter(fmt.Sprintf("tcp dst port %d", synSourcePort)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -204,7 +207,6 @@ func (mod *SynScanner) synScan() error {
|
|||
mod.State.Store("progress", 0.0)
|
||||
mod.State.Store("scanning", &mod.addresses)
|
||||
mod.packets <- nil
|
||||
mod.handle.Close()
|
||||
})
|
||||
|
||||
mod.stats.openPorts = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue