Skip to contentSkip to conversation

mac80211: fix key debugfs default_key link

PATCH New Johannes Berg 1 participant 1 message Apr 8, 2008 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix key debugfs default_key link

The default_key symlink points to the key index rather than they key counter, fix it.

---
 net/mac80211/debugfs_key.c   |    3 ++-
 net/mac80211/ieee80211_key.h |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
net/mac80211/debugfs_key.c +2 -1
@@ -194,6 +194,7 @@ void ieee80211_debugfs_key_add(struct ie
 		return;
 
 	sprintf(buf, "%d", keycount);
+	key->debugfs.cnt = keycount;
 	keycount++;
 	key->debugfs.dir = debugfs_create_dir(buf,
 					local->debugfs.keys);
@@ -246,7 +247,7 @@ void ieee80211_debugfs_key_add_default(s
 	if (!sdata->debugfsdir)
 		return;
 
-	sprintf(buf, "../keys/%d", sdata->default_key->conf.keyidx);
+	sprintf(buf, "../keys/%d", sdata->default_key->debugfs.cnt);
 	sdata->debugfs.default_key =
 		debugfs_create_symlink("default_key", sdata->debugfsdir, buf);
 }
net/mac80211/ieee80211_key.h +1 -0
@@ -115,6 +115,7 @@ struct ieee80211_key {
 		struct dentry *replays;
 		struct dentry *key;
 		struct dentry *ifindex;
+		int cnt;
 	} debugfs;
 #endif