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
a2327b7e8e
commit
855f9b243e
1 changed files with 5 additions and 5 deletions
|
@ -15,9 +15,9 @@ func (w *WiFiModule) onChannel(channel int, cb func()) {
|
||||||
w.stickChan = channel
|
w.stickChan = channel
|
||||||
|
|
||||||
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
||||||
log.Warning("Error while hopping to channel %d: %s", channel, err)
|
log.Warning("error while hopping to channel %d: %s", channel, err)
|
||||||
} else {
|
} else {
|
||||||
log.Debug("Hopped on channel %d", channel)
|
log.Debug("hopped on channel %d", channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
cb()
|
cb()
|
||||||
|
@ -29,7 +29,7 @@ func (w *WiFiModule) channelHopper() {
|
||||||
w.reads.Add(1)
|
w.reads.Add(1)
|
||||||
defer w.reads.Done()
|
defer w.reads.Done()
|
||||||
|
|
||||||
log.Info("Channel hopper started.")
|
log.Info("channel hopper started.")
|
||||||
|
|
||||||
for w.Running() {
|
for w.Running() {
|
||||||
delay := w.hopPeriod
|
delay := w.hopPeriod
|
||||||
|
@ -49,11 +49,11 @@ func (w *WiFiModule) channelHopper() {
|
||||||
channel = w.stickChan
|
channel = w.stickChan
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("Hopping on channel %d", channel)
|
log.Debug("hopping on channel %d", channel)
|
||||||
|
|
||||||
w.chanLock.Lock()
|
w.chanLock.Lock()
|
||||||
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
if err := network.SetInterfaceChannel(w.Session.Interface.Name(), channel); err != nil {
|
||||||
log.Warning("Error while hopping to channel %d: %s", channel, err)
|
log.Warning("error while hopping to channel %d: %s", channel, err)
|
||||||
}
|
}
|
||||||
w.chanLock.Unlock()
|
w.chanLock.Unlock()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue