From cc64fe7b9e3104c4cb990eb410930676de749e02 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 6 Jan 2016 17:17:13 +0200 Subject: [PATCH] mesh: Do not clear link state on driver event if exchange was started If the local driver event for a new peer candidate arrived only after the peer had already initiated the peering exchange, we used to clear the link state. This resulted in the already completed (or in progress) exchange getting abandoned and a new exchange initiated. This is not desirable since the already started (or even completed) exchange can be used. Clear the link state only when adding the new STA entry for the first time, i.e., use the same !sta->my_lid condition in handling the driver event similarly to how the peer initiated cases were already handled. Signed-off-by: Jouni Malinen --- wpa_supplicant/mesh_mpm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/mesh_mpm.c b/wpa_supplicant/mesh_mpm.c index 92e47aabc..def1c4030 100644 --- a/wpa_supplicant/mesh_mpm.c +++ b/wpa_supplicant/mesh_mpm.c @@ -576,7 +576,8 @@ static struct sta_info * mesh_mpm_add_peer(struct wpa_supplicant *wpa_s, return NULL; } - mesh_mpm_init_link(wpa_s, sta); + if (!sta->my_lid) + mesh_mpm_init_link(wpa_s, sta); #ifdef CONFIG_IEEE80211N copy_sta_ht_capab(data, sta, elems->ht_capabilities);