From: Jouni Malinen Date: Mon, 28 Nov 2022 14:35:01 +0000 (+0200) Subject: DPP: Use existing TCP connection to replay duplicate Presence Announcement X-Git-Tag: hostap_2_11~1456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d6cd88eed3ddb5b59acb4cafd000ce1b927cfb8;p=thirdparty%2Fhostap.git DPP: Use existing TCP connection to replay duplicate Presence Announcement Instead of opening a new TCP connection for each received Presence Announcement from the same Enrollee from the Relay to the Controller, use an existing connection if it is still waiting for Authentication Response. This avoids opening multiple parallel sessions between the same Controller and Enrollee. Signed-off-by: Jouni Malinen --- diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c index f51bc1b81..3e7aaade1 100644 --- a/src/common/dpp_tcp.c +++ b/src/common/dpp_tcp.c @@ -628,6 +628,17 @@ int dpp_relay_rx_action(struct dpp_global *dpp, const u8 *src, const u8 *hdr, if (!ctrl) return -1; + if (type == DPP_PA_PRESENCE_ANNOUNCEMENT || + type == DPP_PA_RECONFIG_ANNOUNCEMENT) { + conn = dpp_relay_match_ctrl(ctrl, src, freq, type); + if (conn && + (!conn->auth || conn->auth->waiting_auth_resp)) { + wpa_printf(MSG_DEBUG, + "DPP: Use existing TCP connection to Controller since no Auth Resp seen on it yet"); + return dpp_relay_tx(conn, hdr, buf, len); + } + } + wpa_printf(MSG_DEBUG, "DPP: Authentication Request for a configured Controller"); conn = dpp_relay_new_conn(ctrl, src, freq);