netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] d80211: fix default key symlink creation/cleanup
@ 2007-01-10 20:42 Jan Kiszka
  2007-01-31 18:57 ` Jiri Benc
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2007-01-10 20:42 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Ivo Van Doorn

[-- Attachment #1: Type: text/plain, Size: 2788 bytes --]

Hi Jiri,

here is the revised version of 'don't symlink empty default keys'. Run-tested
and diff'ed against your repos.

Jan


----------

This gets rid of annoying

wlan0: cannot create symlink to default key

in my syslog with latest rt2x00. The patch takes care to always delete an
existing symlink to the default key before trying to register a new one.
Moreover, it avoids to call ieee80211_key_sysfs_add_default for a NULL key.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>

---
 net/d80211/ieee80211_ioctl.c     |    9 ++++-----
 net/d80211/ieee80211_sysfs_sta.c |    3 ++-
 2 files changed, 6 insertions(+), 6 deletions(-)

Index: linux-dscape/net/d80211/ieee80211_ioctl.c
===================================================================
--- linux-dscape.orig/net/d80211/ieee80211_ioctl.c
+++ linux-dscape/net/d80211/ieee80211_ioctl.c
@@ -627,7 +627,7 @@ static int ieee80211_set_encryption(stru
 		}
 		kfree(keyconf);
 
-		if (key && sdata->default_key == key) {
+		if (set_tx_key || sdata->default_key == key) {
 			ieee80211_key_sysfs_remove_default(sdata);
 			sdata->default_key = NULL;
 		}
@@ -671,7 +671,7 @@ static int ieee80211_set_encryption(stru
 			}
 		}
 
-		if (old_key && sdata->default_key == old_key) {
+		if (set_tx_key || sdata->default_key == old_key) {
 			ieee80211_key_sysfs_remove_default(sdata);
 			sdata->default_key = NULL;
 		}
@@ -698,7 +698,7 @@ static int ieee80211_set_encryption(stru
 
 	if (set_tx_key || (!sta && !sdata->default_key && key)) {
 		sdata->default_key = key;
-		if (ieee80211_key_sysfs_add_default(sdata))
+		if (key && ieee80211_key_sysfs_add_default(sdata))
 			printk(KERN_WARNING "%s: cannot create symlink to "
 			       "default key\n", dev->name);
 		if (local->ops->set_key_idx &&
@@ -2892,8 +2892,7 @@ static int ieee80211_ioctl_siwencode(str
 	else if (erq->length == 0) {
 		/* No key data - just set the default TX key index */
 		if (sdata->default_key != sdata->keys[idx]) {
-			if (sdata->default_key)
-				ieee80211_key_sysfs_remove_default(sdata);
+			ieee80211_key_sysfs_remove_default(sdata);
 			sdata->default_key = sdata->keys[idx];
 			if (sdata->default_key)
 				ieee80211_key_sysfs_add_default(sdata);
Index: linux-dscape/net/d80211/ieee80211_sysfs_sta.c
===================================================================
--- linux-dscape.orig/net/d80211/ieee80211_sysfs_sta.c
+++ linux-dscape/net/d80211/ieee80211_sysfs_sta.c
@@ -433,5 +433,6 @@ int ieee80211_key_sysfs_add_default(stru
 
 void ieee80211_key_sysfs_remove_default(struct ieee80211_sub_if_data *sdata)
 {
-	sysfs_remove_link(&sdata->key_kset.kobj, "default");
+	if (sdata->default_key)
+		sysfs_remove_link(&sdata->key_kset.kobj, "default");
 }




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] d80211: fix default key symlink creation/cleanup
  2007-01-10 20:42 [PATCH] d80211: fix default key symlink creation/cleanup Jan Kiszka
@ 2007-01-31 18:57 ` Jiri Benc
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Benc @ 2007-01-31 18:57 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: netdev, Ivo Van Doorn

On Wed, 10 Jan 2007 21:42:01 +0100, Jan Kiszka wrote:
> here is the revised version of 'don't symlink empty default keys'. Run-tested
> and diff'ed against your repos.

Applied, thanks for the patch and sorry for the delay.

 Jiri

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-31 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 20:42 [PATCH] d80211: fix default key symlink creation/cleanup Jan Kiszka
2007-01-31 18:57 ` Jiri Benc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).