From: Johannes Berg <johannes@sipsolutions.net>
To: arwelle@cert.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC] mac80211_hwsim: Implements a check for ATTR_FREQ inside hwsim_cloned_frame_received_nl
Date: Mon, 02 Nov 2015 13:27:13 +0100 [thread overview]
Message-ID: <1446467233.3205.16.camel@sipsolutions.net> (raw)
In-Reply-To: <1446238820-21004-1-git-send-email-arwelle@cert.org>
On Fri, 2015-10-30 at 17:00 -0400, arwelle@cert.org wrote:
> From: Adam Welle <arwelle@cert.org>
>
> If a frame is received from netlink with this value set it is checked
> against the current radio's frequency and discarded if different.
Please line-break the commit log to <=72 characters/line.
> + /* Check ATTR_FREQ if it exists, and throw away off-channel
> packets */
> + if (info->attrs[HWSIM_ATTR_FREQ])
> + rx_status.freq = nla_get_u32(info
> ->attrs[HWSIM_ATTR_FREQ]);
> + else
> + rx_status.freq = data2->channel->center_freq;
> +
> + /* Drop packet if not on the same frequency as this radio */
> + if (rx_status.freq != data2->channel->center_freq)
> + goto out;
>
I think it'd make sense to have that check only in the case that the
attribute existed. I'm not too concerned about performance here, but
more generally it looks odd if you're checking when you know it can't
be different.
johannes
prev parent reply other threads:[~2015-11-02 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 21:00 [RFC] mac80211_hwsim: Implements a check for ATTR_FREQ inside hwsim_cloned_frame_received_nl arwelle
2015-11-02 12:27 ` 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=1446467233.3205.16.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arwelle@cert.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).