mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 18:57:17 -07:00
fix: fixed a panic in net.show.meta when rendeing open ports
This commit is contained in:
parent
2dcfea02ce
commit
31b06638d8
3 changed files with 26 additions and 4 deletions
|
@ -112,7 +112,7 @@ func ParseTargets(targets string, aliasMap *data.UnsortedKV) (ips []net.IP, macs
|
|||
}
|
||||
targets = strings.Trim(targets, ", ")
|
||||
|
||||
fmt.Printf("targets=%s macs=%#v\n", targets, macs)
|
||||
// fmt.Printf("targets=%s macs=%#v\n", targets, macs)
|
||||
|
||||
// check and resolve aliases
|
||||
for _, targetAlias := range aliasParser.FindAllString(targets, -1) {
|
||||
|
|
|
@ -44,7 +44,7 @@ func SetInterfaceChannel(iface string, channel int) error {
|
|||
Debug("SetInterfaceChannel(%s, %d) iw based", iface, channel)
|
||||
out, err := core.Exec("iw", []string{"dev", iface, "set", "channel", fmt.Sprintf("%d", channel)})
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("iw: out=%s err=%s", out, err)
|
||||
} else if out != "" {
|
||||
return fmt.Errorf("Unexpected output while setting interface %s to channel %d: %s", iface, channel, out)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func SetInterfaceChannel(iface string, channel int) error {
|
|||
Debug("SetInterfaceChannel(%s, %d) iwconfig based")
|
||||
out, err := core.Exec("iwconfig", []string{iface, "channel", fmt.Sprintf("%d", channel)})
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("iwconfig: out=%s err=%s", out, err)
|
||||
} else if out != "" {
|
||||
return fmt.Errorf("Unexpected output while setting interface %s to channel %d: %s", iface, channel, out)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue