diff mbox series

How do I increase the max buff size of the scan_result command?

Message ID 12995b8abcf926a093ac8e59e51275b@cweb012.nm.nfra.io
State Not Applicable
Headers show
Series How do I increase the max buff size of the scan_result command? | expand

Commit Message

=?utf-8?B?VGFleW91bmcgS3dvbg==?= Dec. 11, 2018, 3:06 a.m. UTC
Hi

There are about 200 APs in my environment.
This area is a factory, very large, with no walls.
Generally, when I scan, 140 ~ 160 scan is done.

In this situation I check the scan list through wpa_cli.
When I check with the scan_result command, the list is checked up to a maximum of 77.
When I checked it, it seemed that the buff size(reply_size) was limited to 4096.
In fact, if you reduce the reply_size to 128, only one list is printed.
https://w1.fi/cgit/hostap/tree/wpa_supplicant/ctrl_iface.c#n9808
char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
					 char *buf, size_t *resp_len)
{
	char *reply;
	const int reply_size = 4096;
	int reply_len;

I want to check all the scan lists with the scan_result command.
I modified it as follows, but the results of the scan_result command did not increase.

How do I view all the results of a scan with scan_result?

Comments

Jouni Malinen Dec. 19, 2018, 10:24 p.m. UTC | #1
On Tue, Dec 11, 2018 at 12:06:31PM +0900, Taeyoung Kwon wrote:
> There are about 200 APs in my environment.
> This area is a factory, very large, with no walls.
> Generally, when I scan, 140 ~ 160 scan is done.
> 
> In this situation I check the scan list through wpa_cli.
> When I check with the scan_result command, the list is checked up to a maximum of 77.

> I want to check all the scan lists with the scan_result command.

I would not recommend doing that with SCAN_RESULTS. Instead, the best
way of fetching large scan results is by using iteration with the BSS
control interface command, e.g., start with "BSS FIRST" and then
continue with "BSS NEXT-<id>" to get the next entry.
=?utf-8?B?VGFleW91bmcgS3dvbg==?= Dec. 20, 2018, 2:43 a.m. UTC | #2
Hi. Jouni Malinen

I will use the bss command without using scan_result.
I have confirmed that reading the scan list with the bss command from wpa_gui-qt4.

I have also seen the wpa_supplicant control interface documentation.
https://w1.fi/wpa_supplicant/devel/ctrl_iface_page.html
In the BSS description of this document, I have confirmed your answers.

The answer was very helpful.

Thanks,
Taeyoung Kwon

-----Original Message-----
From: "Jouni Malinen"<j@w1.fi> 
To: "Taeyoung Kwon"<xoduddk123@naver.com>; 
Cc: <hostap@lists.infradead.org>; 
Sent: 2018-12-20 (Thu) 07:24:05
Subject: Re: How do I increase the max buff size of the scan_result command?
 
On Tue, Dec 11, 2018 at 12:06:31PM +0900, Taeyoung Kwon wrote:
> There are about 200 APs in my environment.
> This area is a factory, very large, with no walls.
> Generally, when I scan, 140 ~ 160 scan is done.
> 
> In this situation I check the scan list through wpa_cli.
> When I check with the scan_result command, the list is checked up to a maximum of 77.

> I want to check all the scan lists with the scan_result command.

I would not recommend doing that with SCAN_RESULTS. Instead, the best
way of fetching large scan results is by using iteration with the BSS
control interface command, e.g., start with "BSS FIRST" and then
continue with "BSS NEXT-<id>" to get the next entry.
diff mbox series

Patch

diff -uNr wpa_supplicant-2.7.ori/wpa_supplicant/ctrl_iface.c wpa_supplicant-2.7.change/wpa_supplicant/ctrl_iface.c
--- wpa_supplicant-2.7.ori/wpa_supplicant/ctrl_iface.c	2018-12-10 10:08:59.498290690 +0900
+++ wpa_supplicant-2.7.change/wpa_supplicant/ctrl_iface.c	2018-12-10 10:10:45.674290690 +0900
@@ -9805,7 +9805,7 @@ 
 					 char *buf, size_t *resp_len)
 {
 	char *reply;
-	const int reply_size = 4096;
+	const int reply_size = 65535;
 	int reply_len;

 	if (os_strncmp(buf, WPA_CTRL_RSP, os_strlen(WPA_CTRL_RSP)) == 0 ||