From b5aff74e3baa6d0d20449810c7cc0301b635b75e Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 27 Aug 2024 07:21:25 -0700 Subject: [PATCH] dpp: scale PKEX timeout by the number of frequencies used 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 --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");