提交 c284e1da 编写于 作者: P Paul Bolle 提交者: Greg Kroah-Hartman

staging: rtl8192u: remove checks for CONFIG_IEEE80211_CRYPT_TKIP

Ever since rtl8192u was added as a staging driver in v2.6.33 it contained
checks for CONFIG_IEEE80211_CRYPT_TKIP. But the Kconfig symbol
IEEE80211_CRYPT_TKIP was renamed to LIB80211_CRYPT_TKIP in v2.6.29. So
these checks have always evaluated to false. And these checks were rather
odd to begin with, since rtl8192u comes with its own ieee80211 stack,
which has support for TKIP built in.

Now the safe and easy thing to do here would be to remove these checks
and the code they hide. But it turns out that with some minor cleanup
the code currently hidden behind these checks builds cleanly. And by
building it we allow the people actually running this code to test
whether it is any good.

That minor cleanup is needed because ieee80211_encrypt_fragment()
accesses struct sk_buff's data member as if it is a struct
ieee80211_hdr. It's not. See, in ieee80211_xmit() a struct
ieee80211_hdr_3addrqos is skb_put() into the sk_buff with which
ieee80211_encrypt_fragment() will be called. So switch from
ieee80211_hdr to ieee80211_hdr_3addrqos here.
Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 31c207f4
......@@ -352,7 +352,6 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
hdr = (struct ieee80211_hdr_4addr *) skb->data;
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
#ifdef CONFIG_IEEE80211_CRYPT_TKIP
if (ieee->tkip_countermeasures &&
strcmp(crypt->ops->name, "TKIP") == 0) {
if (net_ratelimit()) {
......@@ -362,7 +361,6 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
}
return -1;
}
#endif
atomic_inc(&crypt->refcnt);
res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
......
......@@ -191,20 +191,20 @@ int ieee80211_encrypt_fragment(
printk("=========>%s(), crypt is null\n", __func__);
return -1;
}
#ifdef CONFIG_IEEE80211_CRYPT_TKIP
struct ieee80211_hdr *header;
if (ieee->tkip_countermeasures &&
crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) {
header = (struct ieee80211_hdr *) frag->data;
if (net_ratelimit()) {
struct ieee80211_hdr_3addrqos *header;
header = (struct ieee80211_hdr_3addrqos *)frag->data;
printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
"TX packet to %pM\n",
ieee->dev->name, header->addr1);
}
return -1;
}
#endif
/* To encrypt, frame format is:
* IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册