netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] d80211: don't symlink empty default keys
@ 2007-01-09 22:33 Jan Kiszka
  2007-01-09 22:43 ` Jan Kiszka
  2007-01-10 19:40 ` Jiri Benc
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2007-01-09 22:33 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Ivo Van Doorn

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

This gets rid of annoying

wlan0: cannot create symlink to default key

in my syslog with latest rt2x00. The patch takes care that in case of
(key/old_key == NULL && set_tx_key) the existing default key symlink is
removed correctly. Moreover, it tests for key!=NULL before trying to register
a new default link.

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

---
 ieee80211/ieee80211_ioctl.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: rt2x00/ieee80211/ieee80211_ioctl.c
===================================================================
--- rt2x00.orig/ieee80211/ieee80211_ioctl.c
+++ rt2x00/ieee80211/ieee80211_ioctl.c
@@ -629,7 +629,7 @@ static int ieee80211_set_encryption(stru
 		}
 		kfree(keyconf);
 
-		if (key && sdata->default_key == key) {
+		if (set_tx_key || (key && sdata->default_key == key)) {
 			ieee80211_key_sysfs_remove_default(sdata);
 			sdata->default_key = NULL;
 		}
@@ -673,7 +673,7 @@ static int ieee80211_set_encryption(stru
 			}
 		}
 
-		if (old_key && sdata->default_key == old_key) {
+		if (set_tx_key || (old_key && sdata->default_key == old_key)) {
 			ieee80211_key_sysfs_remove_default(sdata);
 			sdata->default_key = NULL;
 		}
@@ -700,7 +700,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 &&



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

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

* Re: [PATCH] d80211: don't symlink empty default keys
  2007-01-09 22:33 [PATCH] d80211: don't symlink empty default keys Jan Kiszka
@ 2007-01-09 22:43 ` Jan Kiszka
  2007-01-10 19:40 ` Jiri Benc
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2007-01-09 22:43 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Ivo Van Doorn

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

Jan Kiszka wrote:
> This gets rid of annoying
> 
> wlan0: cannot create symlink to default key
> 
> in my syslog with latest rt2x00. The patch takes care that in case of
> (key/old_key == NULL && set_tx_key) the existing default key symlink is
> removed correctly. Moreover, it tests for key!=NULL before trying to register
> a new default link.
> 

Grr, just noticed that the subject was still only reflecting one part of
the patch. Let's call it "fix default key symlink creation/cleanup".

Jan


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

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

* Re: [PATCH] d80211: don't symlink empty default keys
  2007-01-09 22:33 [PATCH] d80211: don't symlink empty default keys Jan Kiszka
  2007-01-09 22:43 ` Jan Kiszka
@ 2007-01-10 19:40 ` Jiri Benc
  2007-01-10 20:05   ` Jan Kiszka
  1 sibling, 1 reply; 5+ messages in thread
From: Jiri Benc @ 2007-01-10 19:40 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: netdev, Ivo Van Doorn

On Tue, 09 Jan 2007 23:33:34 +0100, Jan Kiszka wrote:
> This gets rid of annoying
> 
> wlan0: cannot create symlink to default key
> 
> in my syslog with latest rt2x00. The patch takes care that in case of
> (key/old_key == NULL && set_tx_key) the existing default key symlink is
> removed correctly. Moreover, it tests for key!=NULL before trying to register
> a new default link.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
> 
> ---
>  ieee80211/ieee80211_ioctl.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: rt2x00/ieee80211/ieee80211_ioctl.c
> ===================================================================
> --- rt2x00.orig/ieee80211/ieee80211_ioctl.c
> +++ rt2x00/ieee80211/ieee80211_ioctl.c
> @@ -629,7 +629,7 @@ static int ieee80211_set_encryption(stru
>  		}
>  		kfree(keyconf);
>  
> -		if (key && sdata->default_key == key) {
> +		if (set_tx_key || (key && sdata->default_key == key)) {
>  			ieee80211_key_sysfs_remove_default(sdata);

This is not correct when set_tx_key is set and sdata->default_key is
NULL.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs

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

* Re: [PATCH] d80211: don't symlink empty default keys
  2007-01-10 19:40 ` Jiri Benc
@ 2007-01-10 20:05   ` Jan Kiszka
  2007-01-10 20:11     ` Jiri Benc
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2007-01-10 20:05 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Ivo Van Doorn

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

Jiri Benc wrote:
> On Tue, 09 Jan 2007 23:33:34 +0100, Jan Kiszka wrote:
>> This gets rid of annoying
>>
>> wlan0: cannot create symlink to default key
>>
>> in my syslog with latest rt2x00. The patch takes care that in case of
>> (key/old_key == NULL && set_tx_key) the existing default key symlink is
>> removed correctly. Moreover, it tests for key!=NULL before trying to register
>> a new default link.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
>>
>> ---
>>  ieee80211/ieee80211_ioctl.c |    6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> Index: rt2x00/ieee80211/ieee80211_ioctl.c
>> ===================================================================
>> --- rt2x00.orig/ieee80211/ieee80211_ioctl.c
>> +++ rt2x00/ieee80211/ieee80211_ioctl.c
>> @@ -629,7 +629,7 @@ static int ieee80211_set_encryption(stru
>>  		}
>>  		kfree(keyconf);
>>  
>> -		if (key && sdata->default_key == key) {
>> +		if (set_tx_key || (key && sdata->default_key == key)) {
>>  			ieee80211_key_sysfs_remove_default(sdata);
> 
> This is not correct when set_tx_key is set and sdata->default_key is
> NULL.

Hmm, is this required? Will sysfs_remove_link panic on non-existent
nodes? If yes or if it's considered better style, are you OK with
catching NULL in ieee80211_key_sysfs_remove_default and refactoring the
existing tests along this way?

Jan


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

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

* Re: [PATCH] d80211: don't symlink empty default keys
  2007-01-10 20:05   ` Jan Kiszka
@ 2007-01-10 20:11     ` Jiri Benc
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Benc @ 2007-01-10 20:11 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: netdev, Ivo Van Doorn

On Wed, 10 Jan 2007 21:05:28 +0100, Jan Kiszka wrote:
> Hmm, is this required? Will sysfs_remove_link panic on non-existent
> nodes?

No, it won't.

> If yes or if it's considered better style,

I consider it a better style as it's more tolerant to possible changes
in sysfs_remove_link.

> are you OK with
> catching NULL in ieee80211_key_sysfs_remove_default and refactoring the
> existing tests along this way?

Yes.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs

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

end of thread, other threads:[~2007-01-10 20:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-09 22:33 [PATCH] d80211: don't symlink empty default keys Jan Kiszka
2007-01-09 22:43 ` Jan Kiszka
2007-01-10 19:40 ` Jiri Benc
2007-01-10 20:05   ` Jan Kiszka
2007-01-10 20:11     ` 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).