]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Fix fast IP address allocation for invitation of a persistent group
authormtk30479 <tzu-meng.wang@mediatek.com>
Wed, 24 Jan 2024 03:51:43 +0000 (11:51 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 7 May 2024 21:32:46 +0000 (00:32 +0300)
Allocate static IPv4 address in EAPOL frames during 4-way handshake
instead of DHCP when using P2P invitation. wpa_s->current_bss needs to
be set for the P2P specific IP address assignment mechanism to be used
in wpa_supplicant_rsn_supp_set_config(). This worked for the initial P2P
connection, but not for some cases reinvoking a persistent group.

Since there is only one AP (P2P GO) in the P2P client case, the
conditions added in commit 4d3be9cdd143 ("Postpone updating of
wpa_s->current_bss till association event") are not needed and the
easiest approach for this is to allow current_bss to be set for
p2p_in_invitation cases. If the GO P2P Interface Address (BSSID) could
be determined for all the related cases, this could be addressed a bit
more cleanly by setting the go_bssid argument for
wpas_start_p2p_client(), but that can be left as a possible future step.

Signed-off-by: tzu-meng wang <tzu-meng.wang@mediatek.com>
wpa_supplicant/wpa_supplicant.c

index eeb6675157d245816ebc4dade984f9c099fc0b28..25a844c5815d2cd6ecbd0030155dc71d2db8670f 100644 (file)
@@ -4527,7 +4527,11 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
                eapol_sm_invalidate_cached_session(wpa_s->eapol);
        }
 
-       if (!wpas_driver_bss_selection(wpa_s) || ssid->bssid_set) {
+       if (!wpas_driver_bss_selection(wpa_s) ||
+#ifdef CONFIG_P2P
+           wpa_s->p2p_in_invitation ||
+#endif /* CONFIG_P2P */
+           ssid->bssid_set) {
                wpa_s->current_bss = bss;
 #ifdef CONFIG_HS20
                hs20_configure_frame_filters(wpa_s);