mirror of
https://github.com/bettercap/bettercap
synced 2025-08-11 09:16:57 -07:00
fix: fixed a bug in wifi.recon.channel which made it block if wifi.recon is off
This commit is contained in:
parent
c55aed1ca2
commit
84fe6b72c5
1 changed files with 11 additions and 2 deletions
|
@ -229,7 +229,11 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
|
|||
if ch, err := strconv.Atoi(s); err != nil {
|
||||
return err
|
||||
} else {
|
||||
freqs = append(freqs, network.Dot11Chan2Freq(ch))
|
||||
if f := network.Dot11Chan2Freq(ch); f == 0 {
|
||||
return fmt.Errorf("%d is not a valid wifi channel.", ch)
|
||||
} else {
|
||||
freqs = append(freqs, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -241,8 +245,13 @@ func NewWiFiModule(s *session.Session) *WiFiModule {
|
|||
}
|
||||
}
|
||||
|
||||
log.Debug("new frequencies: %v", freqs)
|
||||
w.frequencies = freqs
|
||||
w.hopChanges <- true
|
||||
|
||||
// if wifi.recon is not running, this would block forever
|
||||
if w.Running() {
|
||||
w.hopChanges <- true
|
||||
}
|
||||
|
||||
return nil
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue