summaryrefslogtreecommitdiff
path: root/net/mac80211/wep.c
diff options
context:
space:
mode:
authorIvan Kuten <ivan.kuten@promwad.com>2008-11-24 15:17:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-11-26 09:47:51 -0500
commit860c6e6a15c5082e1a1ff1faeb56cdf439380e87 (patch)
tree5f5943ed551d0ce38bbbfa0e59152adb4d9b0107 /net/mac80211/wep.c
parentb50563a68520dea3a19b5a8013c4ae0f8e3b49dd (diff)
downloadlinux-860c6e6a15c5082e1a1ff1faeb56cdf439380e87.tar.gz
linux-860c6e6a15c5082e1a1ff1faeb56cdf439380e87.tar.xz
mac80211: fix unaligned access in ieee80211_wep_encrypt_data
Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/wep.c')
-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 @@
#include <linux/err.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
+#include <asm/unaligned.h>
#include <net/mac80211.h>
#include "ieee80211_i.h"
@@ -125,10 +126,10 @@ void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key,
{
struct blkcipher_desc desc = { .tfm = tfm };
struct scatterlist sg;
- __le32 *icv;
+ __le32 icv;
- icv = (__le32 *)(data + data_len);
- *icv = cpu_to_le32(~crc32_le(~0, data, data_len));
+ icv = cpu_to_le32(~crc32_le(~0, data, data_len));
+ put_unaligned(icv, (__le32 *)(data + data_len));
crypto_blkcipher_setkey(tfm, rc4key, klen);
sg_init_one(&sg, data, data_len + WEP_ICV_LEN);