Browse Source

TDLS/nl80211: Support receiving TDLS discovery response frames

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@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
Arik Nemtsov 13 years ago
parent
commit
35287637cc
2 changed files with 18 additions and 0 deletions
  1. 8 0
      src/drivers/driver_nl80211.c
  2. 10 0
      wpa_supplicant/events.c

+ 8 - 0
src/drivers/driver_nl80211.c

@@ -2317,6 +2317,14 @@ 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
+	if ((drv->capa.flags & WPA_DRIVER_FLAGS_TDLS_SUPPORT)) {
+		/* TDLS Discovery Response */
+		if (nl80211_register_action_frame(drv, (u8 *) "\x04\x0e", 2) <
+		    0)
+			return -1;
+	}
+#endif /* CONFIG_TDLS */
 
 	/* FT Action frames */
 	if (nl80211_register_action_frame(drv, (u8 *) "\x06", 1) < 0)

+ 10 - 0
wpa_supplicant/events.c

@@ -2209,6 +2209,16 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 			wnm_action_rx(wpa_s, &data->rx_action);
 			break;
 		}
+#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, "TDLS: Received Discovery "
+				"Response from " MACSTR,
+				MAC2STR(data->rx_action.sa));
+			break;
+		}
+#endif /* CONFIG_TDLS */
 #ifdef CONFIG_P2P
 		wpas_p2p_rx_action(wpa_s, data->rx_action.da,
 				   data->rx_action.sa,