linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jakub Kiciński" <moorray3@wp.pl>
To: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Ivo Van Doorn <IvDoorn@gmail.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>,
	"stf_xl@wp.pl" <stf_xl@wp.pl>,
	Alessandro Lannocca <alessandro.lannocca@gmail.com>,
	Bruno Randolf <br1@thinktube.com>
Subject: Re: [PATCH] mac80211: Allow single vif mac address change with addr_mask
Date: Wed, 22 May 2013 14:42:24 +0200	[thread overview]
Message-ID: <20130522144224.4c95fa04@north> (raw)
In-Reply-To: <CAGXE3d_HQzN5NNJ5tbDXhoeFdobpSJnvxrqAP5+T8DfyEoV_Uw@mail.gmail.com>

On Wed, 22 May 2013 10:06:26 +0200, Helmut Schaa wrote:
> On Tue, May 21, 2013 at 5:10 PM, Jakub Kiciński <moorray3@wp.pl> wrote:
> > On Tue, 21 May 2013 14:54:53 +0200, Helmut Schaa wrote:
> >> When changing the MAC address of a single vif mac80211 will check if the new
> >> address fits into the address mask specified by the driver. This only needs
> >> to be done when using multiple BSSIDs. Hence, check the new address only
> >> against all other vifs.
> >
> > Oh, I see that you already posted this patch for review!
> >
> > I think we should also take care of the way addresses for new
> > interfaces are chosen otherwise they'll just pick up
> > perm_addr and we will end up with incompatible MACs.
> 
> Maybe you could send the assign_pem_addr changes as a follow up patch?

I would rather not, I think it would be messy. Or is your
patch already merged somewhere? 

Perhaps you could incorporate the change to assign_pem_addr
into your patch and send v2 adding my Sign-off?

> > @@ -1479,7 +1483,17 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
> >                         break;
> >                 }
> >
> > +               /*
> > +                * Pick address of existing interface in case user changed
> > +                * MAC address manually, default to perm_addr.
> > +                */
> >                 m = local->hw.wiphy->perm_addr;
> > +               list_for_each_entry(sdata, &local->interfaces, list) {
> > +                       if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
> > +                               continue;
> > +                       m = sdata->vif.addr;
> > +                       break;
> > +               }
> >                 start = ((u64)m[0] << 5*8) | ((u64)m[1] << 4*8) |
> >                         ((u64)m[2] << 3*8) | ((u64)m[3] << 2*8) |
> >                         ((u64)m[4] << 1*8) | ((u64)m[5] << 0*8);
> 
> This is only relevant if the driver registered a addr_mask with mac80211.
> So, maybe you could only select a new address (!=perm_addr) if the
> perm_addr is not covered by the addr_mask?

I'm not sure I understand all the internal logic, but if
driver doesn't set addr_mask it will always get one of
wiphy->addresses or perm_addr and leave on line 1468 [1]
before reaching this code.


[1]http://git.kernel.org/cgit/linux/kernel/git/jberg/mac80211-next.git/tree/net/mac80211/iface.c#n1468

  -- Kuba

  reply	other threads:[~2013-05-22 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 12:54 [PATCH] mac80211: Allow single vif mac address change with addr_mask Helmut Schaa
2013-05-21 15:10 ` Jakub Kiciński
2013-05-22  8:06   ` Helmut Schaa
2013-05-22 12:42     ` Jakub Kiciński [this message]
2013-05-23 13:32       ` Helmut Schaa
2013-05-21 15:51 ` R: " Alessandro Lannocca
2013-05-27  8:43 ` [PATCHv2] " Helmut Schaa
2013-05-27  8:55   ` Johannes Berg

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=20130522144224.4c95fa04@north \
    --to=moorray3@wp.pl \
    --cc=IvDoorn@gmail.com \
    --cc=alessandro.lannocca@gmail.com \
    --cc=br1@thinktube.com \
    --cc=gwingerde@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=stf_xl@wp.pl \
    /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).