From fc61e5fe46c0e830f688c51ff0aba7f9990eaa5a Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Tue, 11 Jan 2022 16:55:53 -0800 Subject: [PATCH] dpp: rework order of operations after being configured Now the result is sent immediately. Prior a connect attempt or scan could have started, potentially losing this frame. In addition the offchannel operation is cancelled after sending the result which will allow the subsequent connect or scan to happen much faster since it doesn't have to wait for ROC to expire. --- src/dpp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dpp.c b/src/dpp.c index 459dc2e9..d7125a09 100644 --- a/src/dpp.c +++ b/src/dpp.c @@ -639,6 +639,11 @@ static void dpp_handle_config_response_frame(const struct mmpdu_header *frame, } dpp_write_config(config, network); + dpp_configuration_free(config); + + send_config_result(dpp, dpp->auth_addr); + + offchannel_cancel(dpp->wdev_id, dpp->offchannel_id); if (network && bss) __station_connect_network(station, network, bss); @@ -647,15 +652,10 @@ static void dpp_handle_config_response_frame(const struct mmpdu_header *frame, dpp_scan_triggered, dpp_scan_results, dpp, dpp_scan_destroy); - if (!dpp->connect_scan_id) - goto scan_failed; + if (dpp->connect_scan_id) + return; } - dpp_configuration_free(config); - - send_config_result(dpp, dpp->auth_addr); - -scan_failed: dpp_reset(dpp); }