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.
This commit is contained in:
Jouni Malinen 2011-10-23 22:12:32 +03:00
parent 8bdedb579a
commit 8c66e18511

View file

@ -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)