misc: small fix or general refactoring i did not bother commenting

This commit is contained in:
Simone Margaritelli 2021-04-09 00:14:52 +02:00
commit 3c506b7809
6 changed files with 9 additions and 10 deletions

View file

@ -9,7 +9,7 @@ import (
func (mod *Module) generateJSONGraph(bssid string) error {
mod.wLock.Lock()
defer mod.wLock.Unlock()
start := time.Now()
if err := mod.updateSettings(); err != nil {
return err

View file

@ -111,7 +111,8 @@ func (mod *Prober) Start() error {
return
}
list, err := iprange.Parse(mod.Session.Interface.CIDR())
cidr := mod.Session.Interface.CIDR()
list, err := iprange.Parse(cidr)
if err != nil {
mod.Fatal("%s", err)
}
@ -125,6 +126,8 @@ func (mod *Prober) Start() error {
addresses := list.Expand()
throttle := time.Duration(mod.throttle) * time.Millisecond
mod.Info("probing %d addresses on %s", len(addresses), cidr)
for mod.Running() {
if mod.probes.MDNS {
mod.sendProbeMDNS(fromIP, fromHW)

View file

@ -24,7 +24,7 @@ func (mod *WiFiModule) isInterfaceConnected() bool {
}
func (mod *WiFiModule) hopUnlocked(channel int) (mustStop bool) {
mod.Debug("hopping on channel %d", channel)
// mod.Debug("hopping on channel %d", channel)
if err := network.SetInterfaceChannel(mod.iface.Name(), channel); err != nil {
// check if the device has been disconnected