diff mbox series

[4/4] dpp: scale PKEX timeout by the number of frequencies used

Message ID 20240827142125.751023-4-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/4] dpp: factor out key derivation and starting PKEX into functions | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Aug. 27, 2024, 2:21 p.m. UTC
If the number of frequencies used is very small reduce the timeout
to avoid waiting for extended periods of time.
---
 src/dpp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/dpp.c b/src/dpp.c
index dad74efe..5d56456d 100644
--- a/src/dpp.c
+++ b/src/dpp.c
@@ -59,6 +59,7 @@ 
 #define DPP_FRAME_RETRY_TIMEOUT 1
 #define DPP_AUTH_PROTO_TIMEOUT 10
 #define DPP_PKEX_PROTO_TIMEOUT 120
+#define DPP_PKEX_PROTO_PER_FREQ_TIMEOUT 10
 
 static uint32_t netdev_watch;
 static struct l_genl_family *nl80211;
@@ -4284,7 +4285,8 @@  static void __dpp_pkex_start_enrollee(struct dpp_sm *dpp)
 {
 	dpp->current_freq = dpp->freqs[0];
 
-	dpp_reset_protocol_timer(dpp, DPP_PKEX_PROTO_TIMEOUT);
+	dpp_reset_protocol_timer(dpp,
+			dpp->freqs_len * DPP_PKEX_PROTO_PER_FREQ_TIMEOUT);
 
 	l_debug("PKEX start enrollee (id=%s)", dpp->pkex_id ?: "unset");