Hi Andrew,
On 8/6/21 9:10 PM, Andrew Zaborowski wrote:
Add a handshake event for use by the AP side for mechanisms that
allocate client IPs during the handshake: P2P address allocation and
FILS address assignment. This is emitted only when EAPOL or the
auth_proto is actually about to send the network configuration data to
the client so that ap.c can skip allocating a DHCP leases altogether if
the client doesn't send the required KDE or IE.
---
src/eapol.c | 8 ++++++++
src/handshake.h | 1 +
src/station.c | 1 +
3 files changed, 10 insertions(+)
diff --git a/src/eapol.c b/src/eapol.c
index f78bef2f..e2892c0e 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -1350,6 +1350,14 @@ static void eapol_send_ptk_3_of_4(struct eapol_sm *sm)
key_data_len += gtk_kde[1] + 2;
}
+ if (sm->handshake->support_ip_allocation &&
+ !sm->handshake->client_ip_addr) {
+ handshake_event(sm->handshake, HANDSHAKE_EVENT_IP_REQUEST);
+
+ if (!sm->handshake->client_ip_addr)
Isn't this condition already checked above?
+ sm->handshake->support_ip_allocation = false;
What happens on retransmissions of PTK 3/4?
+ }
+
if (sm->handshake->support_ip_allocation) {
/* Wi-Fi P2P Technical Specification v1.7 Table 59 */
key_data_buf[key_data_len++] = IE_TYPE_VENDOR_SPECIFIC;
diff --git a/src/handshake.h b/src/handshake.h
index a4c54b5a..1bc1b2fa 100644
--- a/src/handshake.h
+++ b/src/handshake.h
@@ -57,6 +57,7 @@ enum handshake_event {
HANDSHAKE_EVENT_REKEY_FAILED,
HANDSHAKE_EVENT_EAP_NOTIFY,
HANDSHAKE_EVENT_TRANSITION_DISABLE,
+ HANDSHAKE_EVENT_IP_REQUEST,
Do you want to distinguish between P2P IP request and FILS IP Request? Might
make things a bit more explicit ?
};
Regards,
-Denis