From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Pavel Roskin <proski@gnu.org>
Subject: [PATCH 2/3] cfg80211: fix nl80211 disconnected events
Date: Thu, 06 Aug 2009 20:41:33 +0200 [thread overview]
Message-ID: <20090806184234.313983716@sipsolutions.net> (raw)
In-Reply-To: 20090806184131.114246687@sipsolutions.net
When reporting a disconnection to userspace, we try
to report whether it was from the AP or by our own
choice. However, we misreported a broadcast deauth
or disassoc as being by own choice, which is wrong.
Fix this by checking the sender address instead of
the destination address.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/mlme.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- wireless-testing.orig/net/wireless/mlme.c 2009-08-06 20:36:05.000000000 +0200
+++ wireless-testing/net/wireless/mlme.c 2009-08-06 20:40:09.000000000 +0200
@@ -149,7 +149,7 @@ static void __cfg80211_send_deauth(struc
reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
- from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0;
+ from_ap = memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0;
__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap);
} else if (wdev->sme_state == CFG80211_SME_CONNECTING) {
__cfg80211_connect_result(dev, mgmt->bssid, NULL, 0, NULL, 0,
@@ -215,7 +215,7 @@ static void __cfg80211_send_disassoc(str
reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
- from_ap = memcmp(mgmt->da, dev->dev_addr, ETH_ALEN) == 0;
+ from_ap = memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0;
__cfg80211_disconnected(dev, NULL, 0, reason_code, from_ap);
}
--
next prev parent reply other threads:[~2009-08-06 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 18:41 [PATCH 0/3] roaming/disassoc fixes Johannes Berg
2009-08-06 18:41 ` [PATCH 1/3] mac80211: stay authenticated after disassoc Johannes Berg
2009-08-06 18:41 ` Johannes Berg [this message]
2009-08-06 18:41 ` [PATCH 3/3] cfg80211: fix SME association after disassociation Johannes Berg
2009-08-08 3:34 ` [PATCH 0/3] roaming/disassoc fixes Pavel Roskin
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=20090806184234.313983716@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=proski@gnu.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).