diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-13 17:26:57 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 07:01:17 -0500 |
commit | 09f4114e02aac9cbf40553a17580b07ab29715d8 (patch) | |
tree | 819bd443c7d36a45934cae3651c58aed4b19bba9 /net/mac80211/iface.c | |
parent | b998e8bb3e1c6eeae5eab9d6a434563270286c3b (diff) |
mac80211: warn if unexpectedly removing stations
When an interface is brought down it must have been
disconnected (or similar) in all modes other than WDS,
so warn if any stations were removed in other modes.
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index ecf7d15eaa5e..604b4aae3364 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -747,7 +747,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, | |||
747 | unsigned long flags; | 747 | unsigned long flags; |
748 | struct sk_buff *skb, *tmp; | 748 | struct sk_buff *skb, *tmp; |
749 | u32 hw_reconf_flags = 0; | 749 | u32 hw_reconf_flags = 0; |
750 | int i; | 750 | int i, flushed; |
751 | 751 | ||
752 | clear_bit(SDATA_STATE_RUNNING, &sdata->state); | 752 | clear_bit(SDATA_STATE_RUNNING, &sdata->state); |
753 | 753 | ||
@@ -772,11 +772,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, | |||
772 | * (because if we remove a STA after ops->remove_interface() | 772 | * (because if we remove a STA after ops->remove_interface() |
773 | * the driver will have removed the vif info already!) | 773 | * the driver will have removed the vif info already!) |
774 | * | 774 | * |
775 | * This is relevant only in AP, WDS and mesh modes, since in | 775 | * This is relevant only in WDS mode, in all other modes we've |
776 | * all other modes we've already removed all stations when | 776 | * already removed all stations when disconnecting or similar, |
777 | * disconnecting etc. | 777 | * so warn otherwise. |
778 | */ | 778 | */ |
779 | sta_info_flush(sdata); | 779 | flushed = sta_info_flush(sdata); |
780 | WARN_ON_ONCE((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) || | ||
781 | (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1)); | ||
780 | 782 | ||
781 | /* | 783 | /* |
782 | * Don't count this interface for promisc/allmulti while it | 784 | * Don't count this interface for promisc/allmulti while it |