diff options
author | Peter Chubb <peterc@gelato.unsw.edu.au> | 2006-03-23 21:39:47 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-03-24 15:44:57 -0800 |
commit | 4dc6d9cc38cea1004a7f827cf76409ae42231fee (patch) | |
tree | 6c96b23f151565cbc789f7b5004e966437bab056 /net/bridge | |
parent | b2fd16b4ff2508ac16ae994f4bcd941f97754c00 (diff) | |
download | op-kernel-dev-4dc6d9cc38cea1004a7f827cf76409ae42231fee.zip op-kernel-dev-4dc6d9cc38cea1004a7f827cf76409ae42231fee.tar.gz |
[BRIDGE]: Unaligned accesses in the ethernet bridge
I see lots of
kernel unaligned access to 0xa0000001009dbb6f, ip=0xa000000100811591
kernel unaligned access to 0xa0000001009dbb6b, ip=0xa0000001008115c1
kernel unaligned access to 0xa0000001009dbb6d, ip=0xa0000001008115f1
messages in my logs on IA64 when using the ethernet bridge with 2.6.16.
Appended is a patch to fix them.
Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_stp_bpdu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c index 8934a54..a7ba0cc 100644 --- a/net/bridge/br_stp_bpdu.c +++ b/net/bridge/br_stp_bpdu.c @@ -19,6 +19,7 @@ #include <linux/llc.h> #include <net/llc.h> #include <net/llc_pdu.h> +#include <asm/unaligned.h> #include "br_private.h" #include "br_private_stp.h" @@ -59,12 +60,12 @@ static inline void br_set_ticks(unsigned char *dest, int j) { unsigned long ticks = (STP_HZ * j)/ HZ; - *((__be16 *) dest) = htons(ticks); + put_unaligned(htons(ticks), (__be16 *)dest); } static inline int br_get_ticks(const unsigned char *src) { - unsigned long ticks = ntohs(*(__be16 *)src); + unsigned long ticks = ntohs(get_unaligned((__be16 *)src)); return (ticks * HZ + STP_HZ - 1) / STP_HZ; } |