From: Sedat Dilek <sedat.dilek@googlemail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
"Luis R. Rodriguez" <mcgrof@gmail.com>
Subject: Re: [PATCH] cfg80211: sme: deauthenticate on assoc failure
Date: Tue, 20 Oct 2009 09:46:37 +0200 [thread overview]
Message-ID: <2d0a357f0910200046g2a04c1d4v7a62c9e15b403999@mail.gmail.com> (raw)
In-Reply-To: <2d0a357f0910200033t25c6b848x6d321057b69e47e6@mail.gmail.com>
To clarify on the patchset and order:
[quilt series]:
# patches from linux-wireless ML
linux-wireless/0001-Revert-mac80211-fix-SME-warning-by-removing-stale-BS.patch
linux-wireless/mac80211-keep-auth-state-when-assoc-fails.patch
linux-wireless/cfg80211-sme-deauthenticate-on-assoc-failure.patch
- Sedat -
On Tue, Oct 20, 2009 at 9:33 AM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> Is this patch on top of wireless-testing (master-2009-10-16)?
>
> It fails here:
> ...
> Applying patch linux-wireless/mac80211-keep-auth-state-when-assoc-fails.patch
> patching file net/mac80211/mlme.c
> Hunk #1 FAILED at 1457.
> 1 out of 1 hunk FAILED -- rejects in file net/mac80211/mlme.c
> Patch linux-wireless/mac80211-keep-auth-state-when-assoc-fails.patch
> does not apply (enforce with -f)
> ERROR: failed to apply patch series!
>
> Does it need to revert "mac80211: fix SME warning by removing stale
> BSS upon assoc failure"?
>
> - Sedat -
>
> On Tue, Oct 20, 2009 at 8:08 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
>> When the in-kernel SME gets an association failure from
>> the AP we don't deauthenticate, and thus get into a very
>> confused state which will lead to warnings later on. Fix
>> this by actually deauthenticating when the AP indicates
>> an association failure.
>>
>> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
>> ---
>> net/wireless/core.h | 1 +
>> net/wireless/mlme.c | 9 +++++++++
>> net/wireless/sme.c | 21 +++++++++++++++++++--
>> 3 files changed, 29 insertions(+), 2 deletions(-)
>>
>> --- wireless-testing.orig/net/wireless/core.h 2009-10-20 15:02:15.000000000 +0900
>> +++ wireless-testing/net/wireless/core.h 2009-10-20 15:03:20.000000000 +0900
>> @@ -358,6 +358,7 @@ int cfg80211_mgd_wext_connect(struct cfg
>> struct wireless_dev *wdev);
>>
>> void cfg80211_conn_work(struct work_struct *work);
>> +void cfg80211_sme_failed_assoc(struct wireless_dev *wdev);
>> bool cfg80211_sme_failed_reassoc(struct wireless_dev *wdev);
>>
>> /* internal helpers */
>> --- wireless-testing.orig/net/wireless/mlme.c 2009-10-20 15:02:15.000000000 +0900
>> +++ wireless-testing/net/wireless/mlme.c 2009-10-20 15:03:20.000000000 +0900
>> @@ -62,6 +62,7 @@ void cfg80211_send_rx_assoc(struct net_d
>> u8 *ie = mgmt->u.assoc_resp.variable;
>> int i, ieoffs = offsetof(struct ieee80211_mgmt, u.assoc_resp.variable);
>> struct cfg80211_internal_bss *bss = NULL;
>> + bool need_connect_result = true;
>>
>> wdev_lock(wdev);
>>
>> @@ -94,6 +95,14 @@ void cfg80211_send_rx_assoc(struct net_d
>> }
>>
>> WARN_ON(!bss);
>> + } else if (wdev->conn) {
>> + cfg80211_sme_failed_assoc(wdev);
>> + need_connect_result = false;
>> + /*
>> + * do not call connect_result() now because the
>> + * sme will schedule work that does it later.
>> + */
>> + goto out;
>> }
>>
>> if (!wdev->conn && wdev->sme_state == CFG80211_SME_IDLE) {
>> --- wireless-testing.orig/net/wireless/sme.c 2009-10-20 15:02:15.000000000 +0900
>> +++ wireless-testing/net/wireless/sme.c 2009-10-20 15:03:20.000000000 +0900
>> @@ -26,6 +26,7 @@ struct cfg80211_conn {
>> CFG80211_CONN_AUTHENTICATING,
>> CFG80211_CONN_ASSOCIATE_NEXT,
>> CFG80211_CONN_ASSOCIATING,
>> + CFG80211_CONN_DEAUTH_ASSOC_FAIL,
>> } state;
>> u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
>> u8 *ie;
>> @@ -148,6 +149,12 @@ static int cfg80211_conn_do_work(struct
>> NULL, 0,
>> WLAN_REASON_DEAUTH_LEAVING);
>> return err;
>> + case CFG80211_CONN_DEAUTH_ASSOC_FAIL:
>> + __cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
>> + NULL, 0,
>> + WLAN_REASON_DEAUTH_LEAVING);
>> + /* return an error so that we call __cfg80211_connect_result() */
>> + return -EINVAL;
>> default:
>> return 0;
>> }
>> @@ -158,6 +165,7 @@ void cfg80211_conn_work(struct work_stru
>> struct cfg80211_registered_device *rdev =
>> container_of(work, struct cfg80211_registered_device, conn_work);
>> struct wireless_dev *wdev;
>> + u8 bssid[ETH_ALEN];
>>
>> rtnl_lock();
>> cfg80211_lock_rdev(rdev);
>> @@ -173,10 +181,10 @@ void cfg80211_conn_work(struct work_stru
>> wdev_unlock(wdev);
>> continue;
>> }
>> + memcpy(bssid, wdev->conn->params.bssid, ETH_ALEN);
>> if (cfg80211_conn_do_work(wdev))
>> __cfg80211_connect_result(
>> - wdev->netdev,
>> - wdev->conn->params.bssid,
>> + wdev->netdev, bssid,
>> NULL, 0, NULL, 0,
>> WLAN_STATUS_UNSPECIFIED_FAILURE,
>> false, NULL);
>> @@ -337,6 +345,15 @@ bool cfg80211_sme_failed_reassoc(struct
>> return true;
>> }
>>
>> +void cfg80211_sme_failed_assoc(struct wireless_dev *wdev)
>> +{
>> + struct wiphy *wiphy = wdev->wiphy;
>> + struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
>> +
>> + wdev->conn->state = CFG80211_CONN_DEAUTH_ASSOC_FAIL;
>> + schedule_work(&rdev->conn_work);
>> +}
>> +
>> void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
>> const u8 *req_ie, size_t req_ie_len,
>> const u8 *resp_ie, size_t resp_ie_len,
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
next prev parent reply other threads:[~2009-10-20 7:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 6:08 [PATCH] cfg80211: sme: deauthenticate on assoc failure Johannes Berg
2009-10-20 6:24 ` Luis R. Rodriguez
2009-10-20 6:26 ` Johannes Berg
2009-10-20 7:33 ` Sedat Dilek
2009-10-20 7:41 ` Sedat Dilek
2009-10-20 7:46 ` Sedat Dilek [this message]
2009-10-20 7:49 ` Luis R. Rodriguez
2009-10-23 4:07 ` Jouni Malinen
2009-10-23 13:35 ` 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=2d0a357f0910200046g2a04c1d4v7a62c9e15b403999@mail.gmail.com \
--to=sedat.dilek@googlemail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mcgrof@gmail.com \
/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