Update iw txpower syntax to only use int

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.
This commit is contained in:
skooch 2020-03-20 16:07:43 +11:00 committed by GitHub
commit 3612e767d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}