[PATCH] HT: Check remote peer HT Operation IE

Jouni Malinen j at w1.fi
Sun Jan 29 16:05:35 PST 2017


On Fri, Jan 27, 2017 at 01:43:19PM +0900, Masashi Honma wrote:
> The remote mesh STA which had configuration disable_ht40=1 could have
> HT Capabilities IE which includes Supported Channel Width Set = 1 (both
> 20 MHz and 40 MHz operation is supported) even though it had HT
> Operation IE which includes STA Channel Width = 0 (20 MHz channel width
> only). Previously, local peer recognized such a remote peer as 40MHz
> band width enabled STA because local peer only checked HT Capabilities
> IE. This could cause disconnection between disable_ht40=1 mesh STA and
> disable_ht40=0 mesh STA (they could be established but could not ping
> with ath9k_htc device). This patch fixes the issue by refering HT
> Operation IE.

Thanks, applied with some cleanup and fixes. I split this into two
commits to keep the actual change in mesh_mpm.c clearer.

It looks like there are other issues with HT/VHT overrides. I fixed
local channel configuration for VHT capable hardware with disable_vht=1.
However, even with all such issues fixed in wpa_supplicant, the Beacon
frames from mesh STAs seemed to be going out with HT/VHT capabilities
based on hardware/driver capabilities instead of constraint capabilities
after the HT/VHT overrides are applied. I guess this would be a mac80211
change (though, didn't look at any details there) to update or remove
the HT/VHT elements from Beacon frames in some cases.

> +void set_disable_ht40(struct ieee80211_ht_capabilities *htcaps,
> +		      int disabled);

> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> @@ -3857,18 +3857,10 @@ static int wpa_set_disable_ht40(struct wpa_supplicant *wpa_s,

> -	/* Masking these out disables HT40 */
> -	le16 msk = host_to_le16(HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET |
> -				HT_CAP_INFO_SHORT_GI40MHZ);
> -
>  	wpa_msg(wpa_s, MSG_DEBUG, "set_disable_ht40: %d", disabled);
>  
> -	if (disabled)
> -		htcaps->ht_capabilities_info &= ~msk;
> -	else
> -		htcaps->ht_capabilities_info |= msk;
> -
> -	htcaps_mask->ht_capabilities_info |= msk;
> +	set_disable_ht40(htcaps, disabled);
> +	set_disable_ht40(htcaps_mask, 1);

This does not look correct for htcaps_mask. That disabled = 1 would get
the mask cleared, not added which is this old "|= msk" behavior here. I
changed that to use disabled = 0 instead to maintain previous behavior
of wpa_set_disable_ht40().

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list