new: the wifi module can now use an optional wifi.interface parameter in order to use a secondary interface (fixes #488)

This commit is contained in:
evilsocket 2019-03-13 16:04:40 +01:00
commit 758f839e17
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
5 changed files with 34 additions and 14 deletions

View file

@ -13,7 +13,7 @@ func (mod *WiFiModule) onChannel(channel int, cb func()) {
prev := mod.stickChan
mod.stickChan = channel
if err := network.SetInterfaceChannel(mod.Session.Interface.Name(), channel); err != nil {
if err := network.SetInterfaceChannel(mod.iface.Name(), channel); err != nil {
mod.Warning("error while hopping to channel %d: %s", channel, err)
} else {
mod.Debug("hopped on channel %d", channel)
@ -53,7 +53,7 @@ func (mod *WiFiModule) channelHopper() {
mod.Debug("hopping on channel %d", channel)
mod.chanLock.Lock()
if err := network.SetInterfaceChannel(mod.Session.Interface.Name(), channel); err != nil {
if err := network.SetInterfaceChannel(mod.iface.Name(), channel); err != nil {
mod.Warning("error while hopping to channel %d: %s", channel, err)
}
mod.chanLock.Unlock()