]> err.no Git - linux-2.6/blobdiff - net/mac80211/key.c
the scheduled ieee80211 softmac removal
[linux-2.6] / net / mac80211 / key.c
index df0c04cedbe400a53d62bb552d06731292eed9af..f91fb4092652765aa2660695fe99081b85addbab 100644 (file)
@@ -20,8 +20,8 @@
 #include "aes_ccm.h"
 
 
-/*
- * Key handling basics
+/**
+ * DOC: Key handling basics
  *
  * Key handling in mac80211 is done based on per-interface (sub_if_data)
  * keys and per-station keys. Since each station belongs to an interface,
@@ -174,6 +174,9 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
 {
        int idx, defkey;
 
+       if (new)
+               list_add(&new->list, &sdata->key_list);
+
        if (sta) {
                rcu_assign_pointer(sta->key, new);
        } else {
@@ -190,9 +193,6 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
                        ieee80211_set_default_key(sdata, -1);
 
                rcu_assign_pointer(sdata->keys[idx], new);
-               if (new)
-                       list_add(&new->list, &sdata->key_list);
-
                if (defkey && new)
                        ieee80211_set_default_key(sdata, new->conf.keyidx);
        }