aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bridge/br_stp_bpdu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 8934a54792be..a7ba0cce0b46 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -19,6 +19,7 @@
19#include <linux/llc.h> 19#include <linux/llc.h>
20#include <net/llc.h> 20#include <net/llc.h>
21#include <net/llc_pdu.h> 21#include <net/llc_pdu.h>
22#include <asm/unaligned.h>
22 23
23#include "br_private.h" 24#include "br_private.h"
24#include "br_private_stp.h" 25#include "br_private_stp.h"
@@ -59,12 +60,12 @@ static inline void br_set_ticks(unsigned char *dest, int j)
59{ 60{
60 unsigned long ticks = (STP_HZ * j)/ HZ; 61 unsigned long ticks = (STP_HZ * j)/ HZ;
61 62
62 *((__be16 *) dest) = htons(ticks); 63 put_unaligned(htons(ticks), (__be16 *)dest);
63} 64}
64 65
65static inline int br_get_ticks(const unsigned char *src) 66static inline int br_get_ticks(const unsigned char *src)
66{ 67{
67 unsigned long ticks = ntohs(*(__be16 *)src); 68 unsigned long ticks = ntohs(get_unaligned((__be16 *)src));
68 69
69 return (ticks * HZ + STP_HZ - 1) / STP_HZ; 70 return (ticks * HZ + STP_HZ - 1) / STP_HZ;
70} 71}