Search Linux Wireless

Re: [PATCH] cfg80211: fix set_monitor_enabled

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

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.
> Reported-by: Mohammed Shafi <shafi.wireless@xxxxxxxxx>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
why not always do it only on IFACE_UP?

> @@ -893,8 +893,12 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
>         if (!err && ntype != otype && netif_running(dev)) {
> -               cfg80211_update_iface_num(rdev, ntype, 1);
> -               cfg80211_update_iface_num(rdev, otype, -1);
> +               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 :)

To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Linux Kernel]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]     [Free Dating]     [M2M Wireless]

Add to Google Powered by Linux