[RFC 05/13] TDLS/nl80211: support receiving TDLS discovery response frames

Arik Nemtsov arik at wizery.com
Thu Sep 15 06:22:23 EDT 2011


Register for the TDLS discovery response public action frame in nl80211.
Print out a debug message when a discovery-resp frame is received and
validated.

Signed-off-by: Arik Nemtsov <arik at wizery.com>
Cc: Kalyan C Gaddam <chakkal at iit.edu>
---
 src/drivers/driver_nl80211.c |    5 +++++
 wpa_supplicant/events.c      |    9 +++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a46f2bc..5e8abde 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2217,6 +2217,11 @@ static int nl80211_register_action_frames(struct wpa_driver_nl80211_data *drv)
 	if (nl80211_register_action_frame(drv, (u8 *) "\x08\x01", 2) < 0)
 		return -1;
 #endif /* CONFIG_IEEE80211W */
+#ifdef CONFIG_TDLS
+	/* TDLS Discovery Response */
+	if (nl80211_register_action_frame(drv, (u8 *) "\x04\x0e", 2) < 0)
+		return -1;
+#endif
 
 	/* FT Action frames */
 	if (nl80211_register_action_frame(drv, (u8 *) "\x06", 1) < 0)
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index a307eda..1856a63 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2030,6 +2030,15 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 				   data->rx_action.data,
 				   data->rx_action.len, data->rx_action.freq);
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_TDLS
+		if (data->rx_action.category == WLAN_ACTION_PUBLIC &&
+		    data->rx_action.len >= 4 &&
+		    data->rx_action.data[0] == WLAN_TDLS_DISCOVERY_RESPONSE) {
+			wpa_dbg(wpa_s, MSG_DEBUG, "Received TDLS discovery "
+				"response from " MACSTR,
+				MAC2STR(data->rx_action.sa));
+		}
+#endif /* CONFIG_TDLS */
 		break;
 	case EVENT_RX_PROBE_REQ:
 		if (data->rx_probe_req.sa == NULL ||
-- 
1.7.4.1



More information about the HostAP mailing list