From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH v3 5/6] station: cancel hidden network scan when connecting
Date: Wed, 08 Jul 2020 17:04:36 -0700 [thread overview]
Message-ID: <20200709000437.32719-5-prestwoj@gmail.com> (raw)
In-Reply-To: <20200709000437.32719-1-prestwoj@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1611 bytes --]
Before connecting to a hidden network we must scan. During this scan
if another connection attempt comes in the expected behavior is to
abort the original connection. Rather than waiting for the scan to
complete, then canceling the original hidden connection we can just
cancel the hidden scan immediately, reply to dbus, and continue with
the new connection attempt.
---
src/station.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/station.c b/src/station.c
index d7b319d8..35f4a96d 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2474,6 +2474,19 @@ void station_connect_network(struct station *station, struct network *network,
struct l_dbus *dbus = dbus_get_bus();
int err;
+ /*
+ * If a hidden scan is not completed, station_is_busy would not
+ * indicate anything is going on so we need to cancel the scan and
+ * fail the connection now.
+ */
+ if (station->hidden_network_scan_id) {
+ scan_cancel(netdev_get_wdev_id(station->netdev),
+ station->hidden_network_scan_id);
+
+ dbus_pending_reply(&station->hidden_pending,
+ dbus_error_failed(station->hidden_pending));
+ }
+
if (station_is_busy(station)) {
station_disconnect_onconnect(station, network, bss, message);
@@ -2525,6 +2538,8 @@ static bool station_hidden_network_scan_results(int err,
msg = station->hidden_pending;
station->hidden_pending = NULL;
+ /* Zero this now so station_connect_network knows the scan is done */
+ station->hidden_network_scan_id = 0;
if (err) {
dbus_pending_reply(&msg, dbus_error_failed(msg));
--
2.21.1
next prev parent reply other threads:[~2020-07-09 0:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 0:04 [PATCH v3 1/6] wiphy: introduce new radio management APIs James Prestwood
2020-07-09 0:04 ` [PATCH v3 2/6] frame-xchg: refactor to use wiphy work queue James Prestwood
2020-07-09 0:04 ` [PATCH v3 3/6] anqp: refactor to use frame-xchg James Prestwood
2020-07-09 0:04 ` [PATCH v3 4/6] scan: refactor to use wiphy radio work queue James Prestwood
2020-07-09 0:04 ` James Prestwood [this message]
2020-07-09 0:04 ` [PATCH v3 6/6] netdev: use wiphy radio work queue for connections James Prestwood
2020-07-09 15:46 ` [PATCH v3 1/6] wiphy: introduce new radio management APIs Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200709000437.32719-5-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox