Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=01e1f045e65b683fe7203b1e16a915bbb94c15fe
Commit:     01e1f045e65b683fe7203b1e16a915bbb94c15fe
Parent:     a10605e599a7873417043fe2bb559abe719f8a1a
Author:     Daniel Drake <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 22 22:03:42 2007 +0000
Committer:  John W. Linville <[EMAIL PROTECTED]>
CommitDate: Thu Nov 29 18:08:47 2007 -0500

    ieee80211: fix unaligned access in ieee80211_copy_snap
    
    There is no guarantee that data+SNAP_SIZE will reside on an even numbered
    address, so doing a 16 bit read will cause an unaligned access in some
    situations. Based on a patch from Jun Sun.
    
    Signed-off-by: Daniel Drake <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 net/ieee80211/ieee80211_tx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
index a4c3c51..6d06f13 100644
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -144,7 +144,8 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto)
        snap->oui[1] = oui[1];
        snap->oui[2] = oui[2];
 
-       *(u16 *) (data + SNAP_SIZE) = htons(h_proto);
+       h_proto = htons(h_proto);
+       memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16));
 
        return SNAP_SIZE + sizeof(u16);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to