Skip to content

Commit

Permalink
Update iw txpower syntax to only use int
Browse files Browse the repository at this point in the history
This is probably due to a bug in iw, we do this because if we include "mBm", the strtol() that iw does has a check on endptr that returns 2, even if the txpower is valid.
  • Loading branch information
skooch authored Mar 20, 2020
1 parent 140f331 commit 3612e76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion network/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func ActivateInterface(name string) error {
func SetInterfaceTxPower(name string, txpower int) error {
if core.HasBinary("iw") {
Debug("SetInterfaceTxPower(%s, %d) iw based", name, txpower)
if _, err := core.Exec("iw", []string{"dev", name, "set", "txpower", "fixed", fmt.Sprintf("%dmBm",
if _, err := core.Exec("iw", []string{"dev", name, "set", "txpower", "fixed", fmt.Sprintf("%d",
txpower)}); err != nil {
return err
}
Expand Down

0 comments on commit 3612e76

Please sign in to comment.