Commit 4bde0f7d authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

cfg80211: fix two buglets

This fixes two small bugs:
 1) the connect variable is already initialised, and the
    assignment to auth_type overwrites the previous setting
    with a wrong value
 2) when all authentication attempts fail, we need to report
    that we couldn't connect
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a71d62db
...@@ -3680,10 +3680,6 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) ...@@ -3680,10 +3680,6 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
wiphy = &rdev->wiphy; wiphy = &rdev->wiphy;
connect.bssid = NULL;
connect.channel = NULL;
connect.auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM;
if (info->attrs[NL80211_ATTR_MAC]) if (info->attrs[NL80211_ATTR_MAC])
connect.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); connect.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
connect.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]); connect.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
......
...@@ -295,9 +295,8 @@ void cfg80211_sme_rx_auth(struct net_device *dev, ...@@ -295,9 +295,8 @@ void cfg80211_sme_rx_auth(struct net_device *dev,
wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
schedule_work(&rdev->conn_work); schedule_work(&rdev->conn_work);
} else if (status_code != WLAN_STATUS_SUCCESS) { } else if (status_code != WLAN_STATUS_SUCCESS) {
wdev->sme_state = CFG80211_SME_IDLE; __cfg80211_connect_result(dev, mgmt->bssid, NULL, 0, NULL, 0,
kfree(wdev->conn); status_code, false);
wdev->conn = NULL;
} else if (wdev->sme_state == CFG80211_SME_CONNECTING && } else if (wdev->sme_state == CFG80211_SME_CONNECTING &&
wdev->conn->state == CFG80211_CONN_AUTHENTICATING) { wdev->conn->state == CFG80211_CONN_AUTHENTICATING) {
wdev->conn->state = CFG80211_CONN_ASSOCIATE_NEXT; wdev->conn->state = CFG80211_CONN_ASSOCIATE_NEXT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment