[PATCH V4] hostapd: Add Operating Mode Notification support

Jouni Malinen j
Tue Jun 17 14:44:41 PDT 2014


On Sat, Jun 14, 2014 at 12:54:43AM +0300, Jouni Malinen wrote:
> On Mon, Feb 10, 2014 at 01:43:05PM +0100, Marek Kwaczynski wrote:
> > Handling Operating Mode Notification received in Assoc Request.
> 
> > diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
> > @@ -108,6 +108,33 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta,
> > +u16 set_sta_vht_opmode(struct hostapd_data *hapd, struct sta_info *sta,
> > +		       const u8 *vht_oper_notif)
> 
> > +	channel_width = *vht_oper_notif & VHT_OPMODE_CHANNEL_WIDTH_MASK;
> > +
> > +	if (channel_width != VHT_CHANWIDTH_USE_HT &&
> > +	    channel_width != VHT_CHANWIDTH_80MHZ &&
> > +	    channel_width != VHT_CHANWIDTH_160MHZ &&
> > +	    channel_width != VHT_CHANWIDTH_80P80MHZ &&
> > +	    ((*vht_oper_notif & VHT_OPMODE_CHANNEL_RxNSS_MASK) >>
> > +	     VHT_OPMODE_NOTIF_RX_NSS_SHIFT) > VHT_RX_NSS_MAX_STREAMS - 1) {
> > +		sta->flags &= ~WLAN_STA_VHT_OPMODE_ENABLED;
> > +		return WLAN_STATUS_UNSPECIFIED_FAILURE;
> > +	}

> I'm not sure what this is trying to do, but in practice, it does not do
> anything. Was that last item supposed to be ORed with the channel_width
> checks? If so, it would still not do anything with RxNSS mask, but at
> least the channel_width checks would work. Or was this supposed to check
> something else?

I cannot make any sense from this. Even that channel width part cannot
be invalid since it is a two-bit field without any way of encoding
something else than the values 0..3. Furthermore, those VHT_CHANWIDTH_*
defines do not match the bits defined for the Channel Width subfield in
the Operating Mode field.

Since this doesn't do anything now and I cannot think of what this could
be trying to do, I'll just delete these lines. If someone can come up
with an explanation of what should be checked here, a new patch to add
such validation can be considered.
 
-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list