aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_wext.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-05 10:00:23 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-05 10:00:23 (GMT)
commit42f1ee7d1fae8a67a2a48adfda19f9aafc3fef32 (patch)
tree1ccf3e828fbf93e09ea4f5396755f75a8129bb84 /src/drivers/driver_wext.c
parent94abc2f11bb13001c0b688af3abda04a57e1fdd4 (diff)
downloadhostap-42f1ee7d1fae8a67a2a48adfda19f9aafc3fef32.zip
hostap-42f1ee7d1fae8a67a2a48adfda19f9aafc3fef32.tar.gz
hostap-42f1ee7d1fae8a67a2a48adfda19f9aafc3fef32.tar.bz2
Fixed scan buffer increasing with WEXT
We can now handle up to 65535 byte result buffer which is the maximum due to WEXT using 16-bit length field. Previously, this was limited to 32768 bytes in practice even through we tried with 65536 and 131072 buffers which we just truncated into 0 in the 16-bit variable. This more or less doubles the number of BSSes we can received from scan results.
Diffstat (limited to 'src/drivers/driver_wext.c')
-rw-r--r--src/drivers/driver_wext.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index b6273e5..631c63d 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1140,10 +1140,12 @@ static u8 * wpa_driver_wext_giwscan(struct wpa_driver_wext_data *drv,
if (ioctl(drv->ioctl_sock, SIOCGIWSCAN, &iwr) == 0)
break;
- if (errno == E2BIG && res_buf_len < 100000) {
+ if (errno == E2BIG && res_buf_len < 65535) {
os_free(res_buf);
res_buf = NULL;
res_buf_len *= 2;
+ if (res_buf_len > 65535)
+ res_buf_len = 65535; /* 16-bit length field */
wpa_printf(MSG_DEBUG, "Scan results did not fit - "
"trying larger buffer (%lu bytes)",
(unsigned long) res_buf_len);