[PATCH 5/7] TDLS: add ctrl_iface option for flushing all TDLS peers

Ilan Peer ilan.peer
Tue Jun 10 11:19:08 PDT 2014


From: Arik Nemtsov <arik at wizery.com>

Useful for debugging purposes.

Signed-off-by: Arik Nemtsov <arikx.nemtsov at intel.com>
---
 wpa_supplicant/ctrl_iface.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 53e23ff..143d18c 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -584,6 +584,19 @@ static int wpa_supplicant_ctrl_iface_tdls_teardown(
 	u8 peer[ETH_ALEN];
 	int ret;
 
+	if (!addr) {
+		wpa_printf(MSG_DEBUG,
+			   "CTRL_IFACE TDLS_TEARDOWN: invalid address");
+		return -1;
+	}
+
+	/* remove everyone */
+	if (!os_strcmp(addr, "*")) {
+		wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN *");
+		wpa_tdls_teardown_peers(wpa_s->wpa);
+		return 0;
+	}
+
 	if (hwaddr_aton(addr, peer)) {
 		wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN: invalid "
 			   "address '%s'", addr);
-- 
1.7.10.4




More information about the Hostap mailing list