Hi Andy,

this is an update of the patch that makes ESSIDs with length 1 work and
rejects ESSIDs with length 32, because they cause trouble elsewhere.

I haven't tracked down the problem with length 32 yet, but this patch
should improve the overall situation anyway. Please apply.

- Werner
ar6k-essid-one-and-32.patch

This patch allows ESSID with length 1, which were rejected because the
stack assumed iwconfig used a different format in the ioctl's payload.

It also refuses ESSIDs longer than 31 bytes, because there is some
buffer overrun issue buried somewhere else in the stack. In principle,
32 bytes should be fine.

Open issue:
- where is the 32 bytes overrun ?

Signed-off-by: Werner Almesberger <[EMAIL PROTECTED]>

Index: ktrack/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
===================================================================
--- ktrack.orig/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c	2008-09-15 21:18:57.000000000 -0300
+++ ktrack/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c	2008-09-15 21:32:03.000000000 -0300
@@ -264,12 +264,11 @@
     }
 
     /*
-     * iwconfig passes a null terminated string with length including this
-     * so we need to account for this
+     * iwconfig passes a string with length excluding any trailing NUL.
+     * FIXME: we should be able to set an ESSID of 32 bytes, yet things fall
+     * over badly if we do. So we limit the ESSID to 31 bytes.
      */
-    if (data->flags && (!data->length || (data->length == 1) ||
-        ((data->length - 1) > sizeof(ar->arSsid))))
-    {
+    if (data->flags && (!data->length || data->length >= sizeof(ar->arSsid))) {
         /*
          * ssid is invalid
          */

Reply via email to