linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211: Support LIVE_ADDRESS_CHANGE feature
Date: Fri, 04 Oct 2019 09:42:58 -0700	[thread overview]
Message-ID: <0b57c1288016310050ccd6233dda886fc4a89b02.camel@gmail.com> (raw)
In-Reply-To: <90ae00044bc0834d87d3f9fb75ce63dce4cfadd5.camel@gmail.com>

Hi Johannes,

After thinking about this more:

On Fri, 2019-10-04 at 09:25 -0700, James Prestwood wrote:
> On Fri, 2019-10-04 at 13:56 +0200, Johannes Berg wrote:
> > Hi,
> > 
> > I was tempted to apply this (sans the feature advertisement part
> > that
> > I
> > don't think should be in nl80211), but:
> > 
> > > 
> > > Signed-off-by: James Prestwood <prestwoj@gmail.com>
> > 
> > Please add a commit log.
> > 
> > > +static int ieee80211_can_live_addr_change(struct
> > > ieee80211_sub_if_data *sdata)
> > > +{
> > > +	if (netif_carrier_ok(sdata->dev))
> > > +		return -EBUSY;
> > > +
> > > +	switch (sdata->vif.type) {
> > > +	case NL80211_IFTYPE_AP:
> > > +	case NL80211_IFTYPE_P2P_GO:
> > > +	case NL80211_IFTYPE_AP_VLAN:
> > > +	case NL80211_IFTYPE_WDS:
> > > +	case NL80211_IFTYPE_MESH_POINT:
> > > +	case NL80211_IFTYPE_MONITOR:
> > > +	case NL80211_IFTYPE_OCB:
> > > +		/* No further checking required, when started or UP
> > > these
> > > +		 * interface types set carrier
> > > +		 */
> > > +		break;
> > > +	case NL80211_IFTYPE_ADHOC:
> > > +		if (sdata->u.ibss.ssid_len != 0)
> > > +			return -EBUSY;
> > 
> > Can you please document why this is there? Maybe all of the
> > conditions,
> > for that matter.
> > 
> > I'm not even entirely sure it _is_ needed - if we've still not
> > created
> > the IBSS but are scanning for it or trying to merge the MAC address
> > won't really matter yet? Probably?
> 
> I guess its just paranoia, rather be safe than sorry. I can take this
> out, but is "Probably?" a good reason? ;)
> 
> > 
> > > +		break;
> > > +	case NL80211_IFTYPE_STATION:
> > > +	case NL80211_IFTYPE_P2P_CLIENT:
> > > +		if (!list_empty(&sdata->local->roc_list) ||
> > > +					!sdata->local->scanning)
> > > +			return -EBUSY;
> > 
> > AP, mesh and other interfaces *can* scan, so that test should be
> > pulled
> > out to be generic - but then in fact all of them should probably be
> > generic - ROC maybe can't be done on other interfaces yet, but
> > unless
> > you're going to check *which* interface is actually doing the ROC,
> > you
> > should just make that a generic check that applies to all
> > interfaces.
> 
> Ok so no switch statement, simply just check that we aren't
> offchannel
> or scanning. I guess this would then cover the IBSS case too.
> 
> > 
> > If you do care about this being more granular then you should check
> > *which* interface is scanning, and then you can still switch the
> > MAC
> > address for *other* interfaces - but I'd still argue it should be
> > independent of interface type.

So yes these can scan, but this should be covered by the
netif_carrier_ok check which is done first. We can just remove the
switch entirely, but the roc_list/scanning check only matters for
station/p2p_client so checking for the other interface types is kinda
pointless and redundant.

Also I am not sure what you mean by *which* interface. This function is
called on a single interface, so checking what other interfaces are
doing seems strange...

> 
> > 
> > And, I'm confused, but isn't the polarity of the scanning check
> > wrong?
> 
> Ah yeah, after you pointed that out I realized 'scanning' is a bit
> field. I should be doing:
> 
> test_bit(SCAN_HW_SCANNING, &sdata->local->scanning)
> 
> Feel free the merge this, but I haven t had a chance yet to look into
> adding a flag to RTNL (based on what you said in your previous
> email).
> Without some way of telling userspace this is supported, its kinda
> useless IMO.
> 
> Either way I'll send another patch with these things addressed.
> 
> Thanks,
> James
> 
> > 
> > johannes
> > 
> 
> 


  reply	other threads:[~2019-10-04 16:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 19:59 [PATCH 1/2] nl80211: Add LIVE_ADDR_CHANGE feature James Prestwood
2019-09-13 19:59 ` [PATCH 2/2] mac80211: Support LIVE_ADDRESS_CHANGE feature James Prestwood
2019-10-04 11:56   ` Johannes Berg
2019-10-04 16:25     ` James Prestwood
2019-10-04 16:42       ` James Prestwood [this message]
2019-10-07 21:16         ` Johannes Berg
2019-10-08 15:37           ` Denis Kenzior
2019-10-08 15:52             ` Johannes Berg
2019-10-08 15:53               ` Denis Kenzior
2019-10-08 16:24                 ` Johannes Berg
2019-10-08 16:23                   ` Denis Kenzior
2019-10-08 17:08                     ` Johannes Berg
2019-10-08 18:50                       ` Denis Kenzior
2019-10-08 20:16                         ` Johannes Berg
2019-10-08 20:55                           ` Denis Kenzior
2019-10-10 15:18                             ` Johannes Berg
2019-10-07 21:11       ` Johannes Berg
2019-10-08 15:28         ` Denis Kenzior
2019-10-08 15:49           ` Johannes Berg
2019-09-13 20:48 ` [PATCH 1/2] nl80211: Add LIVE_ADDR_CHANGE feature Johannes Berg
2019-09-13 20:56   ` James Prestwood
2019-09-13 21:01     ` Johannes Berg
2019-09-13 21:14       ` James Prestwood
2019-09-17 20:09         ` James Prestwood
2019-10-01  9:14         ` Johannes Berg
2019-10-08 22:13           ` James Prestwood

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=0b57c1288016310050ccd6233dda886fc4a89b02.camel@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=johannes@sipsolutions.net \
    --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).