lkml.org 
[lkml]   [2009]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: p80211wext.c: problem with IW_ENCODE_ALG_WEP
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) {

\
 
 \ /
  Last update: 2009-05-05 15:49    [W:0.206 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site