From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mac80211: fix legacy and invalid rx-rate rpt
Date: Thu, 15 Dec 2016 10:54:42 +0100 [thread overview]
Message-ID: <1481795682.2582.1.camel@sipsolutions.net> (raw)
In-Reply-To: <1481743838-20323-1-git-send-email-greearb@candelatech.com>
On Wed, 2016-12-14 at 11:30 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> 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
prev parent reply other threads:[~2016-12-15 9:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 19:30 [PATCH v2] mac80211: fix legacy and invalid rx-rate rpt greearb
2016-12-15 9:54 ` Johannes Berg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1481795682.2582.1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.