* p80211wext.c: problem with IW_ENCODE_ALG_WEP
@ 2009-05-05 13:22 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2009-05-05 13:22 UTC (permalink / raw)
To: richard, gregkh, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
The expression !(ext->alg & IW_ENCODE_ALG_WEP) appears to be incorrect,
because there are several possible values for ext->alg that give 1 when
bit-anded with IW_ENCODE_ALG_WEP. Therefore Richard Kennedy suggested to
rewrite the code with !
Signed-off-by: Julia Lawall <julia@diku.dk>
---
.../drivers/staging/wlan-ng/p80211wext.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c
index 96078b0..e00e305 100644
--- a/drivers/staging/wlan-ng/p80211wext.c
+++ b/drivers/staging/wlan-ng/p80211wext.c
@@ -1487,7 +1487,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
}
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
+ if (ext->alg != IW_ENCODE_ALG_WEP) {
pr_debug("asked to set a non wep key :(");
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* p80211wext.c: problem with IW_ENCODE_ALG_WEP
@ 2009-05-05 13:22 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2009-05-05 13:22 UTC (permalink / raw)
To: richard, gregkh, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
The expression !(ext->alg & IW_ENCODE_ALG_WEP) appears to be incorrect,
because there are several possible values for ext->alg that give 1 when
bit-anded with IW_ENCODE_ALG_WEP. Therefore Richard Kennedy suggested to
rewrite the code with !=
Signed-off-by: Julia Lawall <julia@diku.dk>
---
.../drivers/staging/wlan-ng/p80211wext.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c
index 96078b0..e00e305 100644
--- a/drivers/staging/wlan-ng/p80211wext.c
+++ b/drivers/staging/wlan-ng/p80211wext.c
@@ -1487,7 +1487,7 @@ static int p80211wext_set_encodeext(struct net_device *dev,
}
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
+ if (ext->alg != IW_ENCODE_ALG_WEP) {
pr_debug("asked to set a non wep key :(");
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: p80211wext.c: problem with IW_ENCODE_ALG_WEP
2009-05-05 13:22 ` Julia Lawall
@ 2009-05-05 13:35 ` Jiri Slaby
-1 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-05-05 13:35 UTC (permalink / raw)
To: Julia Lawall; +Cc: richard, gregkh, linux-kernel, kernel-janitors
On 05/05/2009 03:22 PM, Julia Lawall wrote:
> - if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
> + if (ext->alg != IW_ENCODE_ALG_WEP) {
> pr_debug("asked to set a non wep key :(");
While you're at it, there is a missing \n. Care to post a fix for that too?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: p80211wext.c: problem with IW_ENCODE_ALG_WEP
@ 2009-05-05 13:35 ` Jiri Slaby
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2009-05-05 13:35 UTC (permalink / raw)
To: Julia Lawall; +Cc: richard, gregkh, linux-kernel, kernel-janitors
On 05/05/2009 03:22 PM, Julia Lawall wrote:
> - if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
> + if (ext->alg != IW_ENCODE_ALG_WEP) {
> pr_debug("asked to set a non wep key :(");
While you're at it, there is a missing \n. Care to post a fix for that too?
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: p80211wext.c: problem with IW_ENCODE_ALG_WEP
2009-05-05 13:35 ` Jiri Slaby
@ 2009-05-05 13:47 ` Julia Lawall
-1 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2009-05-05 13:47 UTC (permalink / raw)
To: Jiri Slaby; +Cc: richard, gregkh, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
The expression !(ext->alg & IW_ENCODE_ALG_WEP) appears to be incorrect,
because there are several possible values for ext->alg that give 1 when
bit-anded with IW_ENCODE_ALG_WEP. Therefore Richard Kennedy suggested to
rewrite the code with !
Added \n at the end of the debug string as well.
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/staging/wlan-ng/p80211wext.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c
index 96078b0..74eac34 100644
--- a/drivers/staging/wlan-ng/p80211wext.c
+++ b/drivers/staging/wlan-ng/p80211wext.c
@@ -1487,8 +1487,8 @@ static int p80211wext_set_encodeext(struct net_device *dev,
}
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
- pr_debug("asked to set a non wep key :(");
+ if (ext->alg != IW_ENCODE_ALG_WEP) {
+ pr_debug("asked to set a non wep key :(\n");
return -EINVAL;
}
if (idx) {
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: p80211wext.c: problem with IW_ENCODE_ALG_WEP
@ 2009-05-05 13:47 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2009-05-05 13:47 UTC (permalink / raw)
To: Jiri Slaby; +Cc: richard, gregkh, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
The expression !(ext->alg & IW_ENCODE_ALG_WEP) appears to be incorrect,
because there are several possible values for ext->alg that give 1 when
bit-anded with IW_ENCODE_ALG_WEP. Therefore Richard Kennedy suggested to
rewrite the code with !=
Added \n at the end of the debug string as well.
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/staging/wlan-ng/p80211wext.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wlan-ng/p80211wext.c b/drivers/staging/wlan-ng/p80211wext.c
index 96078b0..74eac34 100644
--- a/drivers/staging/wlan-ng/p80211wext.c
+++ b/drivers/staging/wlan-ng/p80211wext.c
@@ -1487,8 +1487,8 @@ static int p80211wext_set_encodeext(struct net_device *dev,
}
if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- if (!(ext->alg & IW_ENCODE_ALG_WEP)) {
- pr_debug("asked to set a non wep key :(");
+ if (ext->alg != IW_ENCODE_ALG_WEP) {
+ pr_debug("asked to set a non wep key :(\n");
return -EINVAL;
}
if (idx) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-05 13:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-05 13:22 p80211wext.c: problem with IW_ENCODE_ALG_WEP Julia Lawall
2009-05-05 13:22 ` Julia Lawall
2009-05-05 13:35 ` Jiri Slaby
2009-05-05 13:35 ` Jiri Slaby
2009-05-05 13:47 ` Julia Lawall
2009-05-05 13:47 ` Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.