PATCH: inform upper over layers which peer has accepted config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

This patch might require some discussion and some edits.  It is possible that two or more
devices might get configured at the same time.  In this case, the upper layers may wish
to the status of respective devices.  I have tested the dpp_tcp.c code.  I have NOT
unit tested the dpp_supplicant code (I don't have a test setup for that).

Comments?

Eliot


commit 8e13a537cb3a9918219cf492b56f2223a1dd0734
Author: Eliot Lear <lear@xxxxxxxxx>
Date:   Tue Aug 2 14:35:09 2022 +0200

    The upper layers may need to know which peer has just been configured.
    This patch provides the id of the peer for that purpose.
Signed-off-by: Eliot Lear <lear@xxxxxxx>

diff --git a/src/common/dpp_tcp.c b/src/common/dpp_tcp.c
index f51bc1b81..82daca13e 100644
--- a/src/common/dpp_tcp.c
+++ b/src/common/dpp_tcp.c
@@ -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 "conf_status=%d",
+       wpa_msg(conn->msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT "peer=%d conf_status=%d",
+               auth->peer_bi->id,
                auth->conf_resp_status);
        dpp_connection_remove(conn);
 }
@@ -882,7 +883,8 @@ 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 conf_resp_status=%d",
+                       "peer=%d wait_conn_status=1 conf_resp_status=%d",
+                       auth->peer_bi->id,
                        auth->conf_resp_status);
                wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
                auth->waiting_conn_status_result = 1;
@@ -896,7 +898,7 @@ static int dpp_controller_rx_conf_result(struct dpp_connection *conn,
        }
        if (status == DPP_STATUS_OK)
                wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_SENT
-                       "conf_resp_status=%d", auth->conf_resp_status);
+                       "peer=%d conf_resp_status=%d", auth->peer_bi->id,auth->conf_resp_status);
        else
                wpa_msg(msg_ctx, MSG_INFO, DPP_EVENT_CONF_FAILED);
        return -1; /* to remove the completed connection */
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index 8071eced7..3d3210adc 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -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 conf_status=%d",
+                       DPP_EVENT_CONF_SENT "peer=%d wait_conn_status=1 conf_status=%d",
+                       auth->peer_bi->id,
                        auth->conf_resp_status);
                wpa_printf(MSG_DEBUG, "DPP: Wait for Connection Status Result");
                eloop_cancel_timeout(wpas_dpp_config_result_wait_timeout,
@@ -2145,7 +2146,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 "conf_status=%d",
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "peer=%d conf_status=%d",
+                       auth->peer_bi->id,
                        auth->conf_resp_status);
        else
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);
@@ -4196,7 +4198,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 "conf_status=%d",
+               wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_SENT "peer=%d conf_status=%d",
+                       auth->peer_bi->id,
                        auth->conf_resp_status);
        else
                wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_CONF_FAILED);

Attachment: OpenPGP_0x87B66B46D9D27A33.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap

[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux