diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-23 16:54:03 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:45 -0500 |
commit | c771c9d8da1e8292ef8bf7fd4ce135dacc650130 (patch) | |
tree | 79b259a6b0396cbecf9e775c7ba5a80e2c4d94c9 /net/mac80211/util.c | |
parent | 506d03f97d10e54fd27c58c872a98242326d6419 (diff) |
mac80211: add interface list lock
Using only the RTNL has a number of problems, most notably that
ieee80211_iterate_active_interfaces() and other interface list
traversals cannot be done from the internal workqueue because it
needs to be flushed under the RTNL.
This patch introduces a new mutex that protects the interface list
against modifications. A more detailed explanation is part of the
code change.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index fc30f2940e1e..73c7d7345abd 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -468,7 +468,7 @@ void ieee80211_iterate_active_interfaces( | |||
468 | struct ieee80211_local *local = hw_to_local(hw); | 468 | struct ieee80211_local *local = hw_to_local(hw); |
469 | struct ieee80211_sub_if_data *sdata; | 469 | struct ieee80211_sub_if_data *sdata; |
470 | 470 | ||
471 | rtnl_lock(); | 471 | mutex_lock(&local->iflist_mtx); |
472 | 472 | ||
473 | list_for_each_entry(sdata, &local->interfaces, list) { | 473 | list_for_each_entry(sdata, &local->interfaces, list) { |
474 | switch (sdata->vif.type) { | 474 | switch (sdata->vif.type) { |
@@ -489,7 +489,7 @@ void ieee80211_iterate_active_interfaces( | |||
489 | &sdata->vif); | 489 | &sdata->vif); |
490 | } | 490 | } |
491 | 491 | ||
492 | rtnl_unlock(); | 492 | mutex_unlock(&local->iflist_mtx); |
493 | } | 493 | } |
494 | EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); | 494 | EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces); |
495 | 495 | ||