diff options
| author | Jouni Malinen <j@w1.fi> | 2011-07-15 21:49:50 +0300 |
|---|---|---|
| committer | Keith Deacon <kdeacon@ti.com> | 2011-11-15 20:45:51 -0600 |
| commit | 34923382b6649895e24395f2847c66f6325e5467 (patch) | |
| tree | 1ca4401f255e8ac77e8f917ccd4f2153b6741d8f | |
| parent | 094fad54e55dd947a4e96b4ba7f994bb7b72ac4d (diff) | |
| download | android_external_wpa_supplicant_8-34923382b6649895e24395f2847c66f6325e5467.tar.gz android_external_wpa_supplicant_8-34923382b6649895e24395f2847c66f6325e5467.tar.bz2 android_external_wpa_supplicant_8-34923382b6649895e24395f2847c66f6325e5467.zip | |
P2P: Do not reply to Probe Request frame indicating only 802.11b rates
Per P2P specification 2.4.1, P2P Device shall shall not respond to
Probe Request frames that indicate support for only 802.11b rates.
Change-Id: I2c57f3f56dd715efe427b78492d1eaf947536000
Signed-off-by: Vishal Mahaveer <a0271468@ti.com>
| -rw-r--r-- | src/p2p/p2p.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index bef3926c..15e3f0e5 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1653,6 +1653,30 @@ struct wpabuf * p2p_build_probe_resp_ies(struct p2p_data *p2p) } +static int is_11b(u8 rate) +{ + return rate == 0x02 || rate == 0x04 || rate == 0x0b || rate == 0x16; +} + + +static int supp_rates_11b_only(struct ieee802_11_elems *elems) +{ + int num_11b = 0, num_others = 0; + int i; + + if (elems->supp_rates == NULL && elems->ext_supp_rates == NULL) + return 0; + + for (i = 0; elems->supp_rates && i < elems->supp_rates_len; i++) { + if (is_11b(elems->supp_rates[i])) + num_11b++; + else + num_others++; + } + + return num_11b > 0 && num_others == 0; +} + static void p2p_reply_probe(struct p2p_data *p2p, const u8 *addr, const u8 *ie, size_t ie_len) { @@ -1685,6 +1709,11 @@ static void p2p_reply_probe(struct p2p_data *p2p, const u8 *addr, const u8 *ie, return; } + if (supp_rates_11b_only(&elems)) { + /* Indicates support for 11b rates only */ + return; + } + /* Check Requested Device Type match */ wps = ieee802_11_vendor_ie_concat(ie, ie_len, WPS_DEV_OUI_WFA); if (wps && !p2p_match_dev_type(p2p, wps)) { |
