[Prism54-devel] [PATCH] Fix recent breakage for setting full 32-byte ESSID

Junio C Hamano junkio@cox.net
Tue, 03 Feb 2004 02:21:41 -0800


The changes introduced with revision 1.124 incorrectly limits
essid to 31 bytes (it forgets that the incoming length counts
the terminating NUL).  With this patch, the driver can accept
full 32 bytes.  The patch is against CVS snapshot 2004-02-03.

--- a/drivers/net/wireless/prism54/isl_ioctl.c	2004-02-02 23:45:54 -0800
+++ b/drivers/net/wireless/prism54/isl_ioctl.c	2004-02-03 01:37:39 -0800
@@ -772,7 +772,7 @@ prism54_set_essid(struct net_device *nde
 
 	/* Check if we were asked for `any' */
 	if (dwrq->flags && dwrq->length) {
-		if (dwrq->length > min(33, IW_ESSID_MAX_SIZE))
+		if (dwrq->length > min(33, IW_ESSID_MAX_SIZE + 1))
 			return -E2BIG;
 		essid.length = dwrq->length - 1;
 		memcpy(essid.octets, extra, dwrq->length);