diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/iface.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 2acc416e77e..f9f27b9cadb 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -370,6 +370,18 @@ static int ieee80211_stop(struct net_device *dev) | |||
370 | rcu_read_unlock(); | 370 | rcu_read_unlock(); |
371 | 371 | ||
372 | /* | 372 | /* |
373 | * Announce that we are leaving the network, in case we are a | ||
374 | * station interface type. This must be done before removing | ||
375 | * all stations associated with sta_info_flush, otherwise STA | ||
376 | * information will be gone and no announce being done. | ||
377 | */ | ||
378 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | ||
379 | if (sdata->u.mgd.state != IEEE80211_STA_MLME_DISABLED) | ||
380 | ieee80211_sta_deauthenticate(sdata, | ||
381 | WLAN_REASON_DEAUTH_LEAVING); | ||
382 | } | ||
383 | |||
384 | /* | ||
373 | * Remove all stations associated with this interface. | 385 | * Remove all stations associated with this interface. |
374 | * | 386 | * |
375 | * This must be done before calling ops->remove_interface() | 387 | * This must be done before calling ops->remove_interface() |
@@ -454,10 +466,6 @@ static int ieee80211_stop(struct net_device *dev) | |||
454 | netif_addr_unlock_bh(local->mdev); | 466 | netif_addr_unlock_bh(local->mdev); |
455 | break; | 467 | break; |
456 | case NL80211_IFTYPE_STATION: | 468 | case NL80211_IFTYPE_STATION: |
457 | /* Announce that we are leaving the network. */ | ||
458 | if (sdata->u.mgd.state != IEEE80211_STA_MLME_DISABLED) | ||
459 | ieee80211_sta_deauthenticate(sdata, | ||
460 | WLAN_REASON_DEAUTH_LEAVING); | ||
461 | memset(sdata->u.mgd.bssid, 0, ETH_ALEN); | 469 | memset(sdata->u.mgd.bssid, 0, ETH_ALEN); |
462 | del_timer_sync(&sdata->u.mgd.chswitch_timer); | 470 | del_timer_sync(&sdata->u.mgd.chswitch_timer); |
463 | del_timer_sync(&sdata->u.mgd.timer); | 471 | del_timer_sync(&sdata->u.mgd.timer); |