[LEDE-DEV] [PATCH] iwinfo get scan results from wpa_supplicant in station mode. wpa_supplicant return some other info before return results. Loop recv until get real scan results.

Mathias Kresin dev at kresin.me
Fri May 12 15:38:47 PDT 2017


12.05.2017 07:40, Adams:
> ---
>  .../utils/iwinfo/patches/002-wds-scan.patch        |   26 ++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>  create mode 100644 package/network/utils/iwinfo/patches/002-wds-scan.patch
>
> diff --git a/package/network/utils/iwinfo/patches/002-wds-scan.patch b/package/network/utils/iwinfo/patches/002-wds-scan.patch
> new file mode 100644
> index 0000000..46d7a61
> --- /dev/null
> +++ b/package/network/utils/iwinfo/patches/002-wds-scan.patch
> @@ -0,0 +1,26 @@
> +Index: libiwinfo-2016-09-21-fd9e17be/iwinfo_nl80211.c
> +===================================================================
> +--- libiwinfo-2016-09-21-fd9e17be.orig/iwinfo_nl80211.c	2017-05-12 09:15:36.572930342 +0800
> ++++ libiwinfo-2016-09-21-fd9e17be/iwinfo_nl80211.c	2017-05-12 09:19:58.311845210 +0800
> +@@ -2241,6 +2241,12 @@
> + 	/* receive and parse scan results if the wait above didn't time out */
> + 	if (ready && nl80211_wpactl_recv(sock, reply, sizeof(reply)) > 0)
> + 	{
> ++
> ++		while(!strstr(reply, "bssid")) {
> ++			if(nl80211_wpactl_recv(sock, reply, sizeof(reply)) <= 0)
> ++				goto end;
> ++		}
> ++
> + 		nl80211_get_quality_max(ifname, &qmax);
> +
> + 		for (line = strtok_r(reply, "\n", &pos);
> +@@ -2319,7 +2325,7 @@
> +
> + 		*len = count * sizeof(struct iwinfo_scanlist_entry);
> + 	}
> +-
> ++end:
> + 	close(sock);
> + 	unlink(local.sun_path);
> +
>

Hey,

your "Signed-off-by" is missing and it seams the text intended to be the 
commit message made it into to the commit subject. Please have a look at 
our "submitting patches" guideline[0].

Please fix both issues and send an updated version of your patch.

Mathias

[0] https://lede-project.org/submitting-patches



More information about the Lede-dev mailing list