]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
atheros: Fix WEXT SIOCGIWESSID use with WE-21 and newer
authorSubrat Dash <sdash@qca.qualcomm.com>
Thu, 22 Sep 2011 12:42:03 +0000 (15:42 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 22 Sep 2011 12:42:03 +0000 (15:42 +0300)
The "too long" buffer (32+1 octets) prevented AP from starting up with
32 octet SSID with WE-21 and newer. Fix this by reducing the
SIOCGIWESSID buffer length.

src/drivers/driver_atheros.c

index 0587050862cbb7d3f044c225778c59ab84801e52..27ea18f8672c61c1683c8bbe0cd67e77e8db9eb2 100644 (file)
@@ -1334,6 +1334,8 @@ atheros_get_ssid(void *priv, u8 *buf, int len)
        os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ);
        iwr.u.essid.pointer = (caddr_t) buf;
        iwr.u.essid.length = len;
+       iwr.u.essid.length = (len > IW_ESSID_MAX_SIZE) ?
+               IW_ESSID_MAX_SIZE : len;
 
        if (ioctl(drv->ioctl_sock, SIOCGIWESSID, &iwr) < 0) {
                perror("ioctl[SIOCGIWESSID]");