mac80211: don't return -EINVAL upon iwconfig wlan0 rts auto
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 24 Jun 2008 10:37:58 +0000 (13:37 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Jun 2008 13:09:19 +0000 (09:09 -0400)
This patch avoids returning -EINVAL upon iwconfig wlan0 rts auto. If
rts->fixed is 0, then we should choose a default value instead of failing.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/wext.c

index f47d13bdf7f70806b94c768b54aeac1d84663d14..3cbaf5301d00e4cc4091178fbf76ad3a344961bb 100644 (file)
@@ -721,6 +721,9 @@ static int ieee80211_ioctl_siwrts(struct net_device *dev,
 
        if (rts->disabled)
                local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
+       else if (!rts->fixed)
+               /* if the rts value is not fixed, then take default */
+               local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
        else if (rts->value < 0 || rts->value > IEEE80211_MAX_RTS_THRESHOLD)
                return -EINVAL;
        else