Search Linux Wireless

Re: [PATCH v2] mac80211: fix legacy and invalid rx-rate rpt

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

 



On Wed, 2016-12-14 at 11:30 -0800, greearb@xxxxxxxxxxxxxxx wrote:
> From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
> 
> This fixes obtaining the rate info via sta_set_sinfo
> when the rx rate is invalid (for instance, on IBSS
> interface that has received no frames from one of its
> peers).
> 
> This also fixes a more general issue with rinfo->flags
> not being properly initialized for legacy rates.

I'd say this is a bug in the ethtool code - everything assumes (and
everything else makes sure) the whole sinfo struct is initialized to 0
before getting passed to this function.

> +static int sta_set_rate_info_rx(struct sta_info *sta, struct
> rate_info *rinfo)
>  {
>  	u16 rate = ACCESS_ONCE(sta_get_last_rx_stats(sta)-
> >last_rate);
> -
> -	if (rate == STA_STATS_RATE_INVALID)
> -		rinfo->flags = 0;
> -	else
> +	if (rate == STA_STATS_RATE_INVALID) {
> +		return -EINVAL;
> +	} else {
>  		sta_stats_decode_rate(sta->local, rate, rinfo);
> +		return 0;
> +	}

That's weird, I'll fix it.

Applied, with some fixupse.

johannes



[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