fix: fixed compilation of macOS for wifi modules

This commit is contained in:
evilsocket 2019-01-20 18:30:22 +01:00
commit 79279126e6
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
3 changed files with 42 additions and 21 deletions

View file

@ -37,8 +37,19 @@ func getInterfaceName(iface net.Interface) string {
}
func SetInterfaceChannel(iface string, channel int) error {
curr := GetInterfaceChannel(iface)
// the interface is already on this channel
if curr == channel {
return nil
}
_, err := core.Exec(airPortPath, []string{iface, fmt.Sprintf("-c%d", channel)})
return err
if err != nil {
return err
}
SetInterfaceCurrentChannel(iface, channel)
return nil
}
func getFrequenciesFromChannels(output string) ([]int, error) {