[PATCH 2/2] wpa_supplicant: Check rate sets before joining BSS

Jouni Malinen j at w1.fi
Sun Oct 23 10:27:37 EDT 2011


On Wed, Oct 19, 2011 at 01:09:34PM +0200, Christian Lamparter wrote:
> 802.11-2007 7.3.2.2 demands that in order
> to join a BSS all required rates have to
> be supported by the hardware.

Thanks, applied with some changes to not break things.

> +	for (i = 0; i < wpa_s->hw.num_modes; i++) {
> +		for (j = 0; j < modes[i].num_channels; j++) {
> +			int freq = modes[i].channels[j].freq;
> +			if (freq == bss->freq) {
> +				mode = &modes[i];
> +				break;
> +			}
> +		}
> +	}

This ended up picking the last matching mode and in practice, that ends
up being the 802.11b entry with driver_nl80211.c and it never has HT
support indicated.. In other words, the check below for HT support would
have always failed. I changes this to not allow the 802.11g mode to be
overridden.

> +			if (flagged && ((rate_ie[j] & 0x7f) ==
> +			     BSS_MEMBERSHIP_SELECTOR_HT_PHY)) {
> +				if (mode->mcs_set[0] != 0xff) {
> +					wpa_dbg(wpa_s, MSG_DEBUG, "   hardware "
> +						"does not support HT PHY");
> +					return 0;
> +				}

This is problematic since some driver wrappers do not indicate anything
about HT support in the mode information (or well, driver_nl80211.c is
the only one that does). I added a new flag to indicate that the HT
information is known (set for nl80211) and if that is not included, this
validation step is skipped.

> +			/* check for legacy [basic] rates */
> +
> +			/*
> +			 * Shortcut. We have already found a matching rate
> +			 * and this particular rate is not marked as basic.
> +			 * Therefore it's not necessary to support the rate
> +			 * and we can skip the expensive check.
> +			 */

> +	return match;

While this could in theory be correct, I think it is safer to ignore the
non-basic rate match status to avoid hitting issues with drivers that
may not indicate all IEs in scan results. In other words, I changed this
to return success in all cases where a clear missing capability was not
found.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list