From: Jouni Malinen Date: Wed, 23 Jun 2010 03:08:14 +0000 (-0700) Subject: P2P: Fix infinite loop on interface selection for Action frame TX X-Git-Tag: dvd/201105~3^2~177 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=d6ae9950572edc2979be8c36299c8f64aa9c8635;p=mech_eap.orig P2P: Fix infinite loop on interface selection for Action frame TX When the first wpa_supplicant interface is not the correct one for transmitting an Action frame (e.g., P2P Presence Request frame uses a group interface), the code got stuck in an infinite busy loop. Fix the iteration to go through the interfaces properly. --- diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 16864c7..a89faae 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -497,7 +497,7 @@ static void wpas_send_action_cb(void *eloop_ctx, void *timeout_ctx) * driver uses a separate interface for that purpose. However, some * Action frames are actually sent within a P2P Group and when that is * the case, we need to follow power saving (e.g., GO buffering the - * frame for a client in PS mode or a client following the adverised + * frame for a client in PS mode or a client following the advertised * NoA from its GO). To make that easier for the driver, select the * correct group interface here. */ @@ -512,6 +512,7 @@ static void wpas_send_action_cb(void *eloop_ctx, void *timeout_ctx) if (os_memcmp(wpa_s->pending_action_src, iface->own_addr, ETH_ALEN) == 0) break; + iface = iface->next; } if (iface) { wpa_printf(MSG_DEBUG, "P2P: Use group interface %s "