All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/6] dpp: don't allow StartEnrollee while connected
@ 2022-01-08  0:13 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2022-01-08  0:13 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

While connected the driver ends up choosing quite small ROC
durations leading to excessive calls to ROC. This also will
negatively effect any wireless performance for the current
network and possibly lead to missed DPP frames.
---
 src/dpp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/dpp.c b/src/dpp.c
index 61c6b36d..de897266 100644
--- a/src/dpp.c
+++ b/src/dpp.c
@@ -1638,10 +1638,21 @@ static struct l_dbus_message *dpp_dbus_start_enrollee(struct l_dbus *dbus,
 	struct dpp_sm *dpp = user_data;
 	uint32_t freq = band_channel_to_freq(6, BAND_FREQ_2_4_GHZ);
 	struct l_dbus_message *reply;
+	struct station *station = station_find(netdev_get_ifindex(dpp->netdev));
 
 	if (dpp->state != DPP_STATE_NOTHING)
 		return dbus_error_busy(message);
 
+	/*
+	 * Station isn't actually required for DPP itself, although this will
+	 * prevent connecting to the network once configured.
+	 */
+	if (station && station_get_connected_network(station)) {
+		l_warn("cannot be enrollee while connected, please disconnect");
+		return dbus_error_busy(message);
+	} else
+		l_debug("No station device, continuing anyways...");
+
 	dpp->uri = dpp_generate_uri(dpp->pub_asn1, dpp->pub_asn1_len, 2,
 					netdev_get_address(dpp->netdev), &freq,
 					1, NULL, NULL);
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-08  0:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-08  0:13 [PATCH v2 2/6] dpp: don't allow StartEnrollee while connected James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.