Skip to content

Commit

Permalink
cfg80211: clear SSID on disconnect/no connection
Browse files Browse the repository at this point in the history
The SME state machine in cfg80211 uses the SSID stored
in struct wireless_dev internally, but fails to clear
it in multiple places (when giving up on a connection
attempt and when disconnecting). This doesn't matter to
the SME state machine, but does matter for IBSS. Thus,
in those cases, clear the SSID to avoid messing up the
IBSS state machine.

Reported-by: Joerg Albert <jal2@gmx.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Aug 4, 2009
1 parent 847c1e1 commit 8dadadb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/wireless/sme.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
wdev->conn = NULL;
kfree(wdev->connect_keys);
wdev->connect_keys = NULL;
wdev->ssid_len = 0;
return;
}

Expand Down Expand Up @@ -566,6 +567,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,

wdev->current_bss = NULL;
wdev->sme_state = CFG80211_SME_IDLE;
wdev->ssid_len = 0;

if (wdev->conn) {
kfree(wdev->conn->ie);
Expand Down Expand Up @@ -721,6 +723,7 @@ int __cfg80211_connect(struct cfg80211_registered_device *rdev,
wdev->conn = NULL;
wdev->sme_state = CFG80211_SME_IDLE;
wdev->connect_keys = NULL;
wdev->ssid_len = 0;
}

return err;
Expand Down Expand Up @@ -785,6 +788,7 @@ int __cfg80211_disconnect(struct cfg80211_registered_device *rdev,
wdev->sme_state = CFG80211_SME_IDLE;
kfree(wdev->conn);
wdev->conn = NULL;
wdev->ssid_len = 0;
return 0;
}

Expand Down

0 comments on commit 8dadadb

Please sign in to comment.