Search Linux Wireless

Re: [PATCH 2/2] cfg80211: Specify frame and reason code for NL80211_CMD_DEL_STATION

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

 



On Fri, 2014-10-10 at 20:55 +0300, Jouni Malinen wrote:

>   * @mac: MAC address of the station to remove or NULL to remove all stations
> + * @subtype: Management frame subtype to use for indicating removal
> + *	(0 = no guidance on whether to indicate the removal to the station is
> + *	provided, 10 = Disassociation, 12 = Deauthentication)
> + * @reason_code: Reason code for the Disassociation/Deauthentication frame
>   */
>  struct station_del_parameters {
>  	const u8 *mac;
> +	u8 subtype;
> +	u16 reason_code;

the reason_code could end up being zero right now, if userspace doesn't
specify the attribute.

> +	if (info->attrs[NL80211_ATTR_MGMT_SUBTYPE]) {
> +		params.subtype =
> +			nla_get_u8(info->attrs[NL80211_ATTR_MGMT_SUBTYPE]);
> +		if (params.subtype != IEEE80211_STYPE_DISASSOC >> 4 &&
> +		    params.subtype != IEEE80211_STYPE_DEAUTH >> 4)
> +			return -EINVAL;
> +	}
> +
> +	if (info->attrs[NL80211_ATTR_REASON_CODE]) {
> +		params.reason_code =
> +			nla_get_u16(info->attrs[NL80211_ATTR_REASON_CODE]);
> +		if (params.reason_code == 0)
> +			return -EINVAL; /* 0 is reserved */
> +	}

I think you should probably force a reason code to be given when
specifying the subtype. And I'm thinking that defaulting to deauth/3
would be better than leaving it up to the driver(s)?

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