aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Eilam <guy@wizery.com>2011-10-04 03:38:09 +0200
committerKeith Deacon <kdeacon@ti.com>2011-11-15 20:45:50 -0600
commit44039e3a836cec2c38587e07da622161d2ac332e (patch)
treef9a9067c7995108ba3e691395a3820cf7268dec1
parent51c2cc235212a54aefebb2739d2bbf30190c8dc3 (diff)
downloadandroid_external_wpa_supplicant_8-44039e3a836cec2c38587e07da622161d2ac332e.tar.gz
android_external_wpa_supplicant_8-44039e3a836cec2c38587e07da622161d2ac332e.tar.bz2
android_external_wpa_supplicant_8-44039e3a836cec2c38587e07da622161d2ac332e.zip
nl80211: fix the "not disabled" case in disable_11b_rates()
the NL80211_ATTR_TX_RATES attribute should always be part of a NL80211_CMD_SET_TX_BITRATE_MASK command. In case the disabled parameter in the nl80211_disable_11b_rates() is false, the attribute that should be left out of the command message is NL80211_TXRATE_LEGACY - this way, the bitrate mask will be reset to its default. Signed-off-by: Guy Eilam <guy@wizery.com>
-rw-r--r--src/drivers/driver_nl80211.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 91399b98..e8c71def 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6486,9 +6486,6 @@ static int nl80211_disable_11b_rates(struct wpa_driver_nl80211_data *drv,
NL80211_CMD_SET_TX_BITRATE_MASK, 0);
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex);
- if (!disabled)
- goto nla_send;
-
bands = nla_nest_start(msg, NL80211_ATTR_TX_RATES);
if (!bands)
goto nla_put_failure;
@@ -6501,12 +6498,13 @@ static int nl80211_disable_11b_rates(struct wpa_driver_nl80211_data *drv,
band = nla_nest_start(msg, NL80211_BAND_2GHZ);
if (!band)
goto nla_put_failure;
- NLA_PUT(msg, NL80211_TXRATE_LEGACY, 8,
- "\x0c\x12\x18\x24\x30\x48\x60\x6c");
+ if (disabled)
+ NLA_PUT(msg, NL80211_TXRATE_LEGACY, 8,
+ "\x0c\x12\x18\x24\x30\x48\x60\x6c");
nla_nest_end(msg, band);
nla_nest_end(msg, bands);
-nla_send:
+
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
msg = NULL;
if (ret) {