diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-07-29 04:13:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-04 16:43:23 -0400 |
commit | 97af743207466ff8b477e14bfb7af0ba2c93375b (patch) | |
tree | 9fc275981b34346284c1aedd370c54854f5369ae /net/mac80211/iface.c | |
parent | ad2f34b41fd6e2b84c896ccf321d5de0a7c7cd52 (diff) |
mac80211: disable beacons before removing the associated interface
When downing interfaces, it's a good idea to tell the driver to
stop sending beacons; that way the driver doesn't need special
code in ops->remove_interface() when it should already handle the
case in bss_info_changed().
This fixes a potential crash with at least ath5k since the vif
pointer will be nullified while beacon interrupts are still active.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 6c655b6547fb..6614d4ff273d 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -522,6 +522,16 @@ static int ieee80211_stop(struct net_device *dev) | |||
522 | ieee80211_scan_completed(&local->hw, true); | 522 | ieee80211_scan_completed(&local->hw, true); |
523 | } | 523 | } |
524 | 524 | ||
525 | /* | ||
526 | * Disable beaconing for AP and mesh, IBSS can't | ||
527 | * still be joined to a network at this point. | ||
528 | */ | ||
529 | if (sdata->vif.type == NL80211_IFTYPE_AP || | ||
530 | sdata->vif.type == NL80211_IFTYPE_MESH_POINT) { | ||
531 | ieee80211_bss_info_change_notify(sdata, | ||
532 | BSS_CHANGED_BEACON_ENABLED); | ||
533 | } | ||
534 | |||
525 | conf.vif = &sdata->vif; | 535 | conf.vif = &sdata->vif; |
526 | conf.type = sdata->vif.type; | 536 | conf.type = sdata->vif.type; |
527 | conf.mac_addr = dev->dev_addr; | 537 | conf.mac_addr = dev->dev_addr; |