Search Linux Wireless

Re: [PATCH] cfg80211: Pass station supported channel and oper class info to kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static int nl80211_parse_sta_channel_info(struct genl_info *info,
> +				      struct station_parameters *params)
> +{
> +	if (info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]) {
> +		params->supported_channels =
> +		     nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
> +		params->supported_channels_len =
> +		     nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_CHANNELS]);
> +		/*
> +		 * Need to include at least One (first channel, number of
> +		 * channels) tuple for each subband.Thus, reject any trailing
> +		 * byte.
> +		 */
> +		if (params->supported_channels_len % 2)
> +			params->supported_channels_len -= 1;
> +	}

That's not 'reject', that's ignore - and you're also not checking that
it's at least 2 bytes long.

> +
> +	if (info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]) {
> +		params->supported_oper_classes =
> +		 nla_data(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
> +		params->supported_oper_classes_len =
> +		  nla_len(info->attrs[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES]);
> +		/*
> +		 * The value of the Length field of the Supported Operating
> +		 * Classes element is between 2 and 253.
> +		 */
> +		if (params->supported_oper_classes_len < 2 ||
> +		    params->supported_oper_classes_len > 253)
> +			return -EINVAL;

And this would be inconsistent, one is rejected and the other ignored?

Also - you missed sign-off.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux