Search Linux Wireless

Re: [PATCH] cfg80211: fix set_monitor_enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-07-12 at 19:00 +0300, Eliad Peller wrote:
> On Thu, Jul 12, 2012 at 6:15 PM, Johannes Berg
> <johannes@xxxxxxxxxxxxxxxx> wrote:
> > From: Johannes Berg <johannes.berg@xxxxxxxxx>
> >
> > 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux