aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_stp_if.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 58d13f2bd121..a285897a2fb4 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -126,7 +126,9 @@ void br_stp_disable_port(struct net_bridge_port *p)
126/* called under bridge lock */ 126/* called under bridge lock */
127void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr) 127void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
128{ 128{
129 unsigned char oldaddr[6]; 129 /* should be aligned on 2 bytes for compare_ether_addr() */
130 unsigned short oldaddr_aligned[ETH_ALEN >> 1];
131 unsigned char *oldaddr = (unsigned char *)oldaddr_aligned;
130 struct net_bridge_port *p; 132 struct net_bridge_port *p;
131 int wasroot; 133 int wasroot;
132 134
@@ -151,11 +153,14 @@ void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
151 br_become_root_bridge(br); 153 br_become_root_bridge(br);
152} 154}
153 155
154static const unsigned char br_mac_zero[6]; 156/* should be aligned on 2 bytes for compare_ether_addr() */
157static const unsigned short br_mac_zero_aligned[ETH_ALEN >> 1];
155 158
156/* called under bridge lock */ 159/* called under bridge lock */
157void br_stp_recalculate_bridge_id(struct net_bridge *br) 160void br_stp_recalculate_bridge_id(struct net_bridge *br)
158{ 161{
162 const unsigned char *br_mac_zero =
163 (const unsigned char *)br_mac_zero_aligned;
159 const unsigned char *addr = br_mac_zero; 164 const unsigned char *addr = br_mac_zero;
160 struct net_bridge_port *p; 165 struct net_bridge_port *p;
161 166