]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Handle special TDLS direct link key index use
authorJouni Malinen <j@w1.fi>
Sun, 23 Oct 2011 19:12:32 +0000 (22:12 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 23 Oct 2011 19:14:05 +0000 (22:14 +0300)
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.

src/drivers/driver_nl80211.c

index e5ab1b034265f2ab7e7057a26edefba5172b84e2..46ac1d54c735a76c62a66bd44d0f4a1b49200bf2 100644 (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)