Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:34269 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441Ab0FAS2c (ORCPT ); Tue, 1 Jun 2010 14:28:32 -0400 Received: by fxm8 with SMTP id 8so1236339fxm.19 for ; Tue, 01 Jun 2010 11:28:30 -0700 (PDT) Subject: Re: Path for fixed channel issue in aircrack-ng suite [V2] From: Maxim Levitsky To: Richard Farina Cc: Johannes Berg , =?ISO-8859-1?Q?G=E1bor?= Stefanik , Joker Joker , linux-wireless@vger.kernel.org In-Reply-To: <4C000B68.9000305@gmail.com> References: <1274775071.3635.4.camel@jlt3.sipsolutions.net> <1274860275.3658.0.camel@jlt3.sipsolutions.net> <4C000B68.9000305@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 01 Jun 2010 21:28:27 +0300 Message-ID: <1275416907.3778.11.camel@maxim-laptop> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: While debugging recent wireless problems, I gave the aircrack suite a shot, and found this thread. How about this patch to fix this issue: commit fffd6e63ea75850dafbf2ccfb38a4189f43c0282 Author: Maxim Levitsky Date: Tue Jun 1 15:43:21 2010 +0300 wireless: allow to retrieve the channel set on monitor interface This will allow to preserve compatibility with userspace Signed-off-by: Maxim Levitsky diff --git a/net/wireless/chan.c b/net/wireless/chan.c index b01a6f6..09d979b 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -49,9 +49,12 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev, { struct ieee80211_channel *chan; int result; + struct wireless_dev *mon_dev = NULL; - if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) + if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR) { + mon_dev = wdev; wdev = NULL; + } if (wdev) { ASSERT_WDEV_LOCK(wdev); @@ -76,5 +79,8 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev, if (wdev) wdev->channel = chan; + if (mon_dev) + mon_dev->channel = chan; + return 0; }