]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Add config response status value to DPP-CONF-SENT
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 29 Jul 2022 15:55:37 +0000 (18:55 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 29 Jul 2022 15:55:37 +0000 (18:55 +0300)
This can be helpful for upper layers to be able to determine whether the
configuration was rejected.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
src/ap/dpp_hostapd.c
src/common/dpp_tcp.c
wpa_supplicant/dpp_supplicant.c

index 7c7b297058a46ee19b57b1779bc76b278c68d0ff..7055784c4865d7c48a134c3d41bd7e7ca76eb82d 100644 (file)
@@ -1583,7 +1583,8 @@ static void hostapd_dpp_rx_conf_result(struct hostapd_data *hapd, const u8 *src,
 
        if (status == DPP_STATUS_OK && auth->send_conn_status) {
                wpa_msg(hapd->msg_ctx, MSG_INFO,
-                       DPP_EVENT_CONF_SENT "wait_conn_status=1");
+                       DPP_EVENT_CONF_SENT "wait_conn_status=1 conf_status=%d",
+                       auth->conf_resp_status);
                wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
                eloop_cancel_timeout(hostapd_dpp_config_result_wait_timeout,
                                     hapd, NULL);
@@ -1599,7 +1600,8 @@ static void hostapd_dpp_rx_conf_result(struct hostapd_data *hapd, const u8 *src,
        hostapd_drv_send_action_cancel_wait(hapd);
        hostapd_dpp_listen_stop(hapd);
        if (status == DPP_STATUS_OK)
-               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
+                       "conf_status=%d", auth->conf_resp_status);
        else
                wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
        dpp_auth_deinit(auth);
@@ -3142,7 +3144,8 @@ void hostapd_dpp_gas_status_handler(struct hostapd_data *hapd, int ok)
        hostapd_drv_send_action_cancel_wait(hapd);
 
        if (ok)
-               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+               wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
+                       "conf_status=%d", auth->conf_resp_status);
        else
                wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
        dpp_auth_deinit(hapd->dpp_auth);
index e16d9b09b1436428fd067d30869c34318060fa52..ff18a9929d945c2c17b8c28b24866abe1e2b27f2 100644 (file)
@@ -248,7 +248,8 @@ static void dpp_controller_gas_done(struct dpp_connection *conn)
                return;
        }
 
-       wpa_msg(conn->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+       wpa_msg(conn->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d",
+               auth->conf_resp_status);
        dpp_connection_remove(conn);
 }
 
@@ -880,8 +881,9 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn,
 
        status = dpp_conf_result_rx(auth, hdr, buf, len);
        if (status == DPP_STATUS_OK && auth->send_conn_status) {
-               wpa_msg(msg_ctx, MSG_INFO,
-                       DPP_EVENT_CONF_SENT "wait_conn_status=1");
+               wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
+                       "wait_conn_status=1 conf_resp_status=%d",
+                       auth->conf_resp_status);
                wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
                auth->waiting_conn_status_result = 1;
                eloop_cancel_timeout(
@@ -893,7 +895,8 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn,
                return 0;
        }
        if (status == DPP_STATUS_OK)
-               wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT);
+               wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
+                       "conf_resp_status=%d", auth->conf_resp_status);
        else
                wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
        return -1; /* to remove the completed connection */
index fa636fca090f18eacdf4698e1766cd47fe3f4952..8071eced7d7b5f387be5b6d1579152c51a19a8aa 100644 (file)
@@ -2124,7 +2124,8 @@ static void wpas_dpp_rx_conf_result(struct wpa_supplicant *wpa_s, const u8 *src,
                int freq;
 
                wpa_msg(wpa_s, MSG_INFO,
-                       DPP_EVENT_CONF_SENT "wait_conn_status=1");
+                       DPP_EVENT_CONF_SENT "wait_conn_status=1 conf_status=%d",
+                       auth->conf_resp_status);
                wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
                eloop_cancel_timeout(wpas_dpp_config_result_wait_timeout,
                                     wpa_s, NULL);
@@ -2144,7 +2145,8 @@ static void wpas_dpp_rx_conf_result(struct wpa_supplicant *wpa_s, const u8 *src,
        offchannel_send_action_done(wpa_s);
        wpas_dpp_listen_stop(wpa_s);
        if (status == DPP_STATUS_OK)
-               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT);
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d",
+                       auth->conf_resp_status);
        else
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);
        dpp_auth_deinit(auth);
@@ -4194,7 +4196,8 @@ wpas_dpp_gas_status_handler(void *ctx, struct wpabuf *resp, int ok)
        offchannel_send_action_done(wpa_s);
        wpas_dpp_listen_stop(wpa_s);
        if (ok)
-               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT);
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "conf_status=%d",
+                       auth->conf_resp_status);
        else
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);
        dpp_auth_deinit(wpa_s->dpp_auth);