Skip to content

Commit

Permalink
mac80211: Drop DS Channel PARAM in directed probe
Browse files Browse the repository at this point in the history
Do not send DS Channel parameter for directed probe requests
in order to maximize the chance that we get a response.  Some
badly-behaved APs don't respond when this parameter is included.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Paul Stewart authored and John W. Linville committed Jun 27, 2011
1 parent ce2dd3c commit a806c55
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -1350,10 +1350,12 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
u8 *dst,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len);
const u8 *ie, size_t ie_len,
bool directed);
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len);
const u8 *ie, size_t ie_len,
bool directed);

void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
const size_t supp_rates_len,
Expand Down
5 changes: 3 additions & 2 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,8 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
ieee80211_send_nullfunc(sdata->local, sdata, 0);
} else {
ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0);
ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
true);
}

ifmgd->probe_send_count++;
Expand Down Expand Up @@ -1289,7 +1290,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,

ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
ssid + 2, ssid[1], NULL, 0);
ssid + 2, ssid[1], NULL, 0, true);

return skb;
}
Expand Down
3 changes: 2 additions & 1 deletion net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
sdata, NULL,
local->scan_req->ssids[i].ssid,
local->scan_req->ssids[i].ssid_len,
local->scan_req->ie, local->scan_req->ie_len);
local->scan_req->ie, local->scan_req->ie_len,
false);

/*
* After sending probe requests, wait for probe responses
Expand Down
21 changes: 16 additions & 5 deletions net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,8 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
u8 *dst,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len)
const u8 *ie, size_t ie_len,
bool directed)
{
struct ieee80211_local *local = sdata->local;
struct sk_buff *skb;
Expand All @@ -1035,8 +1036,16 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
return NULL;
}

chan = ieee80211_frequency_to_channel(
local->hw.conf.channel->center_freq);
/*
* Do not send DS Channel parameter for directed probe requests
* in order to maximize the chance that we get a response. Some
* badly-behaved APs don't respond when this parameter is included.
*/
if (directed)
chan = 0;
else
chan = ieee80211_frequency_to_channel(
local->hw.conf.channel->center_freq);

buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
local->hw.conf.channel->band,
Expand All @@ -1062,11 +1071,13 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,

void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len)
const u8 *ie, size_t ie_len,
bool directed)
{
struct sk_buff *skb;

skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len);
skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len,
directed);
if (skb)
ieee80211_tx_skb(sdata, skb);
}
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/work.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
* will not answer to direct packet in unassociated state.
*/
ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid,
wk->probe_auth.ssid_len, NULL, 0);
wk->probe_auth.ssid_len, NULL, 0, true);

wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
run_again(local, wk->timeout);
Expand Down

0 comments on commit a806c55

Please sign in to comment.