aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-06 20:41:33 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:12:46 -0400
commite458b8a22d33eef62765c9f89889efeb4041f073 (patch)
treee738ffebfecb0e461ca033528dd39a8b86839770 /net
parente21546a2a3953a7d4b9d5c9b1cf12184ffceab96 (diff)
cfg80211: fix nl80211 disconnected events
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/mlme.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index b44b6c024c1..51d5df67c63 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -149,7 +149,7 @@ static void __cfg80211_send_deauth(struct net_device *dev,
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(struct net_device *dev,
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);
}