aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/wep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c
index 7bbb98e846a3..7043ddc75498 100644
--- a/net/mac80211/wep.c
+++ b/net/mac80211/wep.c
@@ -17,6 +17,7 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/scatterlist.h> 19#include <linux/scatterlist.h>
20#include <asm/unaligned.h>
20 21
21#include <net/mac80211.h> 22#include <net/mac80211.h>
22#include "ieee80211_i.h" 23#include "ieee80211_i.h"
@@ -125,10 +126,10 @@ void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
125{ 126{
126 struct blkcipher_desc desc = { .tfm = tfm }; 127 struct blkcipher_desc desc = { .tfm = tfm };
127 struct scatterlist sg; 128 struct scatterlist sg;
128 __le32 *icv; 129 __le32 icv;
129 130
130 icv = (__le32 *)(data + data_len); 131 icv = cpu_to_le32(~crc32_le(~0, data, data_len));
131 *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); 132 put_unaligned(icv, (__le32 *)(data + data_len));
132 133
133 crypto_blkcipher_setkey(tfm, rc4key, klen); 134 crypto_blkcipher_setkey(tfm, rc4key, klen);
134 sg_init_one(&sg, data, data_len + WEP_ICV_LEN); 135 sg_init_one(&sg, data, data_len + WEP_ICV_LEN);