]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mac80211: deauth when interface is marked down
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 1 Dec 2008 19:56:41 +0000 (14:56 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 5 Dec 2008 14:32:10 +0000 (09:32 -0500)
It seems like proper etiquette to let other stations know when we are
going down in either STA or IBSS mode.  This also notifies userland, so
wpa_supplicant doesn't get confused.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/iface.c

index 46082125f3e19f9e9a889ec26c87fcb7aa23f69b..9ab772ac74aefec4c93d47784eaae05b92239d2c 100644 (file)
@@ -435,7 +435,11 @@ static int ieee80211_stop(struct net_device *dev)
                break;
        case NL80211_IFTYPE_STATION:
        case NL80211_IFTYPE_ADHOC:
-               sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED;
+               /* Announce that we are leaving the network. */
+               if (sdata->u.sta.state != IEEE80211_STA_MLME_DISABLED)
+                       ieee80211_sta_deauthenticate(sdata,
+                                               WLAN_REASON_DEAUTH_LEAVING);
+
                memset(sdata->u.sta.bssid, 0, ETH_ALEN);
                del_timer_sync(&sdata->u.sta.timer);
                /*