diff mbox

Cannot disable transmission retry

Message ID 1433262583.7119.5.camel@A1-HR-PC (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show

Commit Message

Hodaszi, Robert June 2, 2015, 4:29 p.m. UTC
Hello,

On kernel 3.13, I was able to disable the transmission retries on the
wlan0 interface with 'iwconfig wlan0 retry 0'. Now I updated my kernel
to 3.16, and it returns with 'Invalid argument' error.

The cause is this commit:

cfg80211: add sanity check for retry limit in wext-compat
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f5aa0d21dd5ada040ff42b4d40357285e4ace441





I'm wondering, is the 'retry->value < 1' is necessary? I would write
'retry->value < 0' instead, to make possible to disable the retries.
Should I send a patch?

Thanks!

Robert Hodaszi

Comments

Johannes Berg June 3, 2015, 7:54 a.m. UTC | #1
+patch author

> - if (retry->disabled ||
> + if (retry->disabled || retry->value < 1 || retry->value > 255 ||
> (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
> return -EINVAL;
> 
> 
> 
> I'm wondering, is the 'retry->value < 1' is necessary? I would write
> 'retry->value < 0' instead, to make possible to disable the retries.
> Should I send a patch?

I think this is likely some confusion over what "retry" means. Some
places in the code used to take it as "# of transmission attempts",
others (imho more correctly) interpret it as "# of retries".

I think it's probably fine to change to < 0.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -370,7 +370,7 @@  static int cfg80211_wext_siwretry(struct net_device
*dev,
u8 oshort = wdev->wiphy->retry_short;
int err;

- if (retry->disabled ||
+ if (retry->disabled || retry->value < 1 || retry->value > 255 ||
(retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
return -EINVAL;