From: Johannes Berg <johannes@sipsolutions.net>
To: Luca Coelho <luca@coelho.fi>, Jouni Malinen <jouni@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org, Vamsi Krishna <vamsin@qti.qualcomm.com>
Subject: Re: [PATCH 1/2] nl80211: Use different attrs for BSSID and random MAC addr in scan req
Date: Mon, 28 Nov 2016 15:14:56 +0100 [thread overview]
Message-ID: <1480342496.8107.41.camel@sipsolutions.net> (raw)
In-Reply-To: <1480063462.2517.105.camel@coelho.fi>
> > + * @NL80211_ATTR_BSSID: The BSSID of the AP (various uses). Note
> > that
>
> The BSSID may also be used for other things, like P2P GO, right? Also
> "various uses" is probably unnecessary? Every command using this
> attribute should describe it's use in their description.
>
>
> >
> > + * %NL80211_ATTR_MAC has also been used in various
> > commands/events for
> > + * specifying the BSSID.
>
> This can be a bit confusing. Maybe you can specify which commands
> *used* to use NL80211_ATTR_MAC but now use NL80211_ATTR_BSSID?
I'd actually avoid that, let's not make the "compatibility quirks" part
of the documentation people read through normally ... In the code,
that's fine, but here, I think less so.
With that, perhaps just rephrase this to
"The BSSID of the AP. Note that %NL80211_ATTR_MAC is also used in
various commands/events for specifying the BSSID."
> > - if (info->attrs[NL80211_ATTR_MAC])
> > + /* Initial implementation used NL80211_ATTR_MAC to set the
> > specific
> > + * BSSID to scan for. This was problematic because that
> > same attribute
> > + * was already used for another purpose (local random MAC
> > address). The
> > + * NL80211_ATTR_BSSID attribute was added to fix this. For
> > backwards
> > + * compatibility with older userspace components, also use
> > the
> > + * NL80211_ATTR_MAC value here if it can be determined to
> > be used for
> > + * the specific BSSID use case instead of the random MAC
> > address
> > + * (NL80211_ATTR_SCAN_FLAGS is used to enable random MAC
> > address use).
> > + */
>
> You should probably add this information to the
> NL80211_CMD_TRIGGER_SCAN description.
It may need an update to refer to ATTR_BSSID, but again I don't think
all the compatibility discussion should be there.
>
> >
> > + if (info->attrs[NL80211_ATTR_BSSID])
> > + memcpy(request->bssid,
> > + nla_data(info->attrs[NL80211_ATTR_BSSID]),
> > ETH_ALEN);
> > + else if (!info->attrs[NL80211_ATTR_SCAN_FLAGS] &&
>
> You should actually check that the SCAN_FLAGS attribute either
> doesn't
> exist (as you already do) or, if it exists, that it doesn't have the
> NL80211_SCAN_FLAG_RANDOM_ADDR flags.
>
Agree with that, that would make sense.
johannes
prev parent reply other threads:[~2016-11-28 14:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 22:07 [PATCH 1/2] nl80211: Use different attrs for BSSID and random MAC addr in scan req Jouni Malinen
2016-11-23 22:07 ` [PATCH 2/2] cfg80211: Add support to sched scan to report better BSSs Jouni Malinen
2016-11-25 9:21 ` Luca Coelho
2016-12-02 21:48 ` Malinen, Jouni
2016-11-27 20:51 ` Arend Van Spriel
2016-11-28 14:20 ` Johannes Berg
2016-11-28 14:34 ` Luca Coelho
2016-11-28 14:17 ` Johannes Berg
2016-11-25 8:44 ` [PATCH 1/2] nl80211: Use different attrs for BSSID and random MAC addr in scan req Luca Coelho
2016-11-28 14:14 ` 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=1480342496.8107.41.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jouni@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=luca@coelho.fi \
--cc=vamsin@qti.qualcomm.com \
/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).