From: Johannes Berg <johannes@sipsolutions.net>
To: Eliad Peller <eliad@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] cfg80211: fix set_monitor_enabled
Date: Thu, 12 Jul 2012 18:03:19 +0200 [thread overview]
Message-ID: <1342108999.4531.34.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <CAB3XZEdfVAgNH4vP6B0O36riyDokpf+UHEG-+Yqn2a1Xjpt8ow@mail.gmail.com> (sfid-20120712_180024_704992_BE7FE31F)
On Thu, 2012-07-12 at 19:00 +0300, Eliad Peller wrote:
> On Thu, Jul 12, 2012 at 6:15 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > When bringing monitor mode up with a driver using the
> > mac80211 virtual monitor interface this resulted in a
> > warning because cfg80211_update_iface_num() is called
> > from PRE_UP, which causes it to call mac80211 and the
> > low-level driver before the device is started.
> >
> > For the case that another interface is added and the
> > monitor interface should be removed, this is correct.
> > However, in the case where a monitor interface is
> > added, it's not correct as the above.
> >
> > To fix this, we need to split up the cases and track
> > whether or not "only monitor" is active so that the
> > code can correctly call into the driver when things
> > change.
> why not always do it only on IFACE_UP?
Yeah .. thought so too at first, but it doesn't work, say you have this
situation:
* up moni0 (monitor)
* up wlan0 (managed)
Then the set_monitor_enabled(false) should happen before wlan0 is
brought up, otherwise mac80211/the driver will correctly reject wlan0
being brought up.
> > + cfg80211_update_iface_num(rdev, ntype,
> > + CFG80211_IFACE_DOWN);
> > + cfg80211_update_iface_num(rdev, ntype,
> > + CFG80211_IFACE_PRE_UP);
> > + cfg80211_update_iface_num(rdev, otype,
> > + CFG80211_IFACE_UP);
>
> this sequence (down(new_type), pre_up (new_type), up(old_type))
> doesn't make any sense to me :)
Ouch. Thanks, will fix, it should obviously be down(new_type),
pre_up(new_type), up(new_type).
johannes
next prev parent reply other threads:[~2012-07-12 16:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 15:15 [PATCH] cfg80211: fix set_monitor_enabled Johannes Berg
2012-07-12 16:00 ` Eliad Peller
2012-07-12 16:03 ` Johannes Berg [this message]
2012-07-12 16:26 ` Eliad Peller
2012-07-12 16:31 ` Johannes Berg
2012-07-12 16:37 ` Eliad Peller
2012-07-12 17:07 ` 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=1342108999.4531.34.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=eliad@wizery.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 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).