Patchwork [V2] tdls: teardown TDLS using wpas_drv_tlds_oper() if not external

login
register
mail settings
Submitter Arend van Spriel
Date July 11, 2013, 10:23 a.m.
Message ID <1373538236-4451-1-git-send-email-arend@broadcom.com>
Download mbox | patch
Permalink /patch/258396/
State Accepted
Commit 4ed8d954dd4f714ac648b25fc3ec260592fda41b
Headers show

Comments

Arend van Spriel - July 11, 2013, 10:23 a.m.
When the device indicates to take care of TDLS operations the TDLS
setup is done calling wpas_drv_tdls_oper(). This patch does a similar
thing for the teardown. This fixes failure of teardown:

"TDLS: Could not find peer <mac> for link Teardown"

Signed-hostap: Arend van Spriel <arend@broadcom.com>
---
My bad. The previous patch did not compile :-(

This patch replaces message with
Message-ID: <1373478498-3721-1-git-send-email-arend@broadcom.com>

Regards,
Arend
---
 wpa_supplicant/ctrl_iface.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Jouni Malinen - July 20, 2013, 2:53 p.m.
On Thu, Jul 11, 2013 at 12:23:56PM +0200, Arend van Spriel wrote:
> When the device indicates to take care of TDLS operations the TDLS
> setup is done calling wpas_drv_tdls_oper(). This patch does a similar
> thing for the teardown. This fixes failure of teardown:
> 
> "TDLS: Could not find peer <mac> for link Teardown"

Thanks, applied.

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index a9c7715..f462d87 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -577,6 +577,7 @@  static int wpa_supplicant_ctrl_iface_tdls_teardown(
 	struct wpa_supplicant *wpa_s, char *addr)
 {
 	u8 peer[ETH_ALEN];
+	int ret;
 
 	if (hwaddr_aton(addr, peer)) {
 		wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN: invalid "
@@ -587,8 +588,13 @@  static int wpa_supplicant_ctrl_iface_tdls_teardown(
 	wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN " MACSTR,
 		   MAC2STR(peer));
 
-	return wpa_tdls_teardown_link(wpa_s->wpa, peer,
-				      WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+	if (wpa_tdls_is_external_setup(wpa_s->wpa))
+		ret = wpa_tdls_teardown_link(wpa_s->wpa, peer,
+			WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+	else
+		ret = wpa_drv_tdls_oper(wpa_s, TDLS_TEARDOWN, peer);
+
+	return ret;
 }
 
 #endif /* CONFIG_TDLS */