* [PATCH] orinoco: fix setting transmit key only
@ 2006-07-14 15:41 Dan Williams
0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2006-07-14 15:41 UTC (permalink / raw)
To: netdev; +Cc: linville, Pavel Roskin, Jean Tourrilhes
When determining whether there's a key to set or not, orinoco should be
looking at the key length, not the key data. Otherwise confusion reigns
when trying to set TX key only, passing in zero-length key, but non-NULL
pointer. Key length takes precedence over non-NULL key data.
Signed-off-by: Dan Williams <dcbw@redhat.com>
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 8a31b59..1e69bc6 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -2876,7 +2876,7 @@ static int orinoco_ioctl_setiwencode(str
if (orinoco_lock(priv, &flags) != 0)
return -EBUSY;
- if (erq->pointer) {
+ if (erq->length > 0) {
if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
index = priv->tx_key;
@@ -2919,7 +2919,7 @@ static int orinoco_ioctl_setiwencode(str
if (erq->flags & IW_ENCODE_RESTRICTED)
restricted = 1;
- if (erq->pointer) {
+ if (erq->pointer && erq->length > 0) {
priv->keys[index].len = cpu_to_le16(xlen);
memset(priv->keys[index].data, 0,
sizeof(priv->keys[index].data));
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-14 15:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-14 15:41 [PATCH] orinoco: fix setting transmit key only Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox