aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_stp_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_stp_if.c')
-rw-r--r--net/bridge/br_stp_if.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index f494496373d6..9d5a414a3943 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -178,7 +178,7 @@ void br_stp_set_enabled(struct net_bridge *br, unsigned long val)
178/* called under bridge lock */ 178/* called under bridge lock */
179void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr) 179void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
180{ 180{
181 /* should be aligned on 2 bytes for compare_ether_addr() */ 181 /* should be aligned on 2 bytes for ether_addr_equal() */
182 unsigned short oldaddr_aligned[ETH_ALEN >> 1]; 182 unsigned short oldaddr_aligned[ETH_ALEN >> 1];
183 unsigned char *oldaddr = (unsigned char *)oldaddr_aligned; 183 unsigned char *oldaddr = (unsigned char *)oldaddr_aligned;
184 struct net_bridge_port *p; 184 struct net_bridge_port *p;
@@ -191,12 +191,11 @@ void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
191 memcpy(br->dev->dev_addr, addr, ETH_ALEN); 191 memcpy(br->dev->dev_addr, addr, ETH_ALEN);
192 192
193 list_for_each_entry(p, &br->port_list, list) { 193 list_for_each_entry(p, &br->port_list, list) {
194 if (!compare_ether_addr(p->designated_bridge.addr, oldaddr)) 194 if (ether_addr_equal(p->designated_bridge.addr, oldaddr))
195 memcpy(p->designated_bridge.addr, addr, ETH_ALEN); 195 memcpy(p->designated_bridge.addr, addr, ETH_ALEN);
196 196
197 if (!compare_ether_addr(p->designated_root.addr, oldaddr)) 197 if (ether_addr_equal(p->designated_root.addr, oldaddr))
198 memcpy(p->designated_root.addr, addr, ETH_ALEN); 198 memcpy(p->designated_root.addr, addr, ETH_ALEN);
199
200 } 199 }
201 200
202 br_configuration_update(br); 201 br_configuration_update(br);
@@ -205,7 +204,7 @@ void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
205 br_become_root_bridge(br); 204 br_become_root_bridge(br);
206} 205}
207 206
208/* should be aligned on 2 bytes for compare_ether_addr() */ 207/* should be aligned on 2 bytes for ether_addr_equal() */
209static const unsigned short br_mac_zero_aligned[ETH_ALEN >> 1]; 208static const unsigned short br_mac_zero_aligned[ETH_ALEN >> 1];
210 209
211/* called under bridge lock */ 210/* called under bridge lock */
@@ -227,7 +226,7 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br)
227 226
228 } 227 }
229 228
230 if (compare_ether_addr(br->bridge_id.addr, addr) == 0) 229 if (ether_addr_equal(br->bridge_id.addr, addr))
231 return false; /* no change */ 230 return false; /* no change */
232 231
233 br_stp_change_bridge_id(br, addr); 232 br_stp_change_bridge_id(br, addr);