diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-04-13 04:43:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-16 15:59:57 -0400 |
commit | 245cbe7a65f3e17999de276ea1c84538f3a7451e (patch) | |
tree | 68cb786f942886c781e027ce80fc682c1e9ac033 /net | |
parent | b16bd15c379410f2aa47837aa4a0de5712856ad5 (diff) |
mac80211: fix key todo list order
When we add multiple todo entries, we rely on them being executed
mostly in the right order, especially when a key is being replaced.
But when a default key is replaced, the todo list order will differ
from the order when the key being replaced is not a default key, so
problems will happen. Hence, just move each todo item to the end of
the list when it is added so we can in the other code ensure that
hw accel for a key will be disabled before it is enabled for the
replacement.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/key.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index b98711dcdc54..150d66dbda9d 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -74,9 +74,12 @@ static void add_todo(struct ieee80211_key *key, u32 flag) | |||
74 | 74 | ||
75 | spin_lock(&todo_lock); | 75 | spin_lock(&todo_lock); |
76 | key->flags |= flag; | 76 | key->flags |= flag; |
77 | /* only add if not already added */ | 77 | /* |
78 | if (list_empty(&key->todo)) | 78 | * Remove again if already on the list so that we move it to the end. |
79 | list_add(&key->todo, &todo_list); | 79 | */ |
80 | if (!list_empty(&key->todo)) | ||
81 | list_del(&key->todo); | ||
82 | list_add_tail(&key->todo, &todo_list); | ||
80 | schedule_work(&todo_work); | 83 | schedule_work(&todo_work); |
81 | spin_unlock(&todo_lock); | 84 | spin_unlock(&todo_lock); |
82 | } | 85 | } |