Parcourir la source

nl80211: Handle special TDLS direct link key index use

An ugly hack is currently used to indicate keys for TDLS direct link:
key_idx == -1. That needs to be converted to 0 for cfg80211 to accept
the key.
Jouni Malinen il y a 13 ans
Parent
commit
8c66e18511
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      src/drivers/driver_nl80211.c

+ 4 - 0
src/drivers/driver_nl80211.c

@@ -3164,6 +3164,10 @@ static int wpa_driver_nl80211_set_key(const char *ifname, void *priv,
 		   "set_tx=%d seq_len=%lu key_len=%lu",
 		   __func__, ifindex, alg, addr, key_idx, set_tx,
 		   (unsigned long) seq_len, (unsigned long) key_len);
+#ifdef CONFIG_TDLS
+	if (key_idx == -1)
+		key_idx = 0;
+#endif /* CONFIG_TDLS */
 
 	msg = nlmsg_alloc();
 	if (!msg)