[PATCH] fix setting transmit key index with older orinoco/prism54 drivers

Dan Williams dcbw
Sat Jan 12 22:45:09 PST 2008

I can't see why this is a problem with recent kernels, since both the
orinoco and prism54 drivers seem to handle this case correctly from a
scan of their IWENCODE handlers.  However, it was certainly an issue
with older drivers for these cards, where they would reject attempts to
set the transmit key because they expected that the key would be NULL if
the key length was 0.

I believe the regression possibility is small, because (a) it only
affects drivers that don't support IWENCODEEXT of which there are few,
and (b) we've been running it in Fedora for almost 2 years now.

diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index f8eb29e..97b0169 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1778,7 +1778,7 @@ int wpa_driver_wext_set_key(void *priv, wpa_alg alg,
 		os_memset(&iwr, 0, sizeof(iwr));
 		os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
 		iwr.u.encoding.flags = key_idx + 1;
-		iwr.u.encoding.pointer = (caddr_t) key;
+		iwr.u.encoding.pointer = (caddr_t) NULL;
 		iwr.u.encoding.length = 0;
 		if (ioctl(drv->ioctl_sock, SIOCSIWENCODE, &iwr) < 0) {
 			perror("ioctl[SIOCSIWENCODE] (set_tx)");

More information about the Hostap mailing list