[PATCH] show entire list of networks in wpagui

Victor Ananyev vindex10 at gmail.com
Wed Sep 18 15:50:46 PDT 2019


>From 96552aaedb7faf4d432f366f3933447efb9e6ad4 Mon Sep 17 00:00:00 2001
From: Victor Ananyev <vindex10 at gmail.com>
Date: Thu, 19 Sep 2019 00:12:23 +0200
Subject: [PATCH] show entire list of networks in wpagui

exploit LAST_ID of LIST_NETWORKS to load all of them iteratively

Signed-off-by: Victor Ananyev <vindex10 at gmail.com>
---
 wpa_supplicant/wpa_gui-qt4/wpagui.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
index a0aa05ed3..b6bd3e1da 100644
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -12,6 +12,8 @@

 #include <cstdio>
 #include <unistd.h>
+#include <chrono>
+#include <thread>
 #include <QMessageBox>
 #include <QCloseEvent>
 #include <QImageReader>
@@ -715,7 +717,22 @@ void WpaGui::updateNetworks()

  if (last)
  break;
+
  start = end + 1;
+ if (*start)
+ continue;
+
+ std::this_thread::sleep_for(std::chrono::milliseconds(200));  //
avoid race conditions
+ QString cmd("LIST_NETWORKS LAST_ID=");
+ cmd.append(id);
+ if (ctrlRequest(cmd.toLocal8Bit().constData(), buf, &len) < 0)
+ break;
+
+ buf[len] = '\0';
+ start = strchr(buf, '\n');
+ if (start == NULL)
+ break;
+ start++;
  }

  if (networkSelect->count() > 1)
-- 
2.21.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-show-entire-list-of-networks-in-wpagui.patch
Type: text/x-patch
Size: 1316 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20190919/578cc7bb/attachment.bin>


More information about the Hostap mailing list