aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_stp_if.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-10-25 18:04:59 -0400
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-10-31 13:34:10 -0500
commit6ede2463c8d7ea949f8e7ef35243490c415ddc2f (patch)
tree161ec1e8ec68dfd48b80706a08f253bb48e9c3cf /net/bridge/br_stp_if.c
parent581c1b14394aee60aff46ea67d05483261ed6527 (diff)
[BRIDGE]: Use ether_compare
Use compare_ether_addr in bridge code. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/bridge/br_stp_if.c')
-rw-r--r--net/bridge/br_stp_if.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 0da11ff05fa3..ac09b6a23523 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -15,6 +15,7 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/smp_lock.h> 17#include <linux/smp_lock.h>
18#include <linux/etherdevice.h>
18 19
19#include "br_private.h" 20#include "br_private.h"
20#include "br_private_stp.h" 21#include "br_private_stp.h"
@@ -133,10 +134,10 @@ static void br_stp_change_bridge_id(struct net_bridge *br,
133 memcpy(br->dev->dev_addr, addr, ETH_ALEN); 134 memcpy(br->dev->dev_addr, addr, ETH_ALEN);
134 135
135 list_for_each_entry(p, &br->port_list, list) { 136 list_for_each_entry(p, &br->port_list, list) {
136 if (!memcmp(p->designated_bridge.addr, oldaddr, ETH_ALEN)) 137 if (!compare_ether_addr(p->designated_bridge.addr, oldaddr))
137 memcpy(p->designated_bridge.addr, addr, ETH_ALEN); 138 memcpy(p->designated_bridge.addr, addr, ETH_ALEN);
138 139
139 if (!memcmp(p->designated_root.addr, oldaddr, ETH_ALEN)) 140 if (!compare_ether_addr(p->designated_root.addr, oldaddr))
140 memcpy(p->designated_root.addr, addr, ETH_ALEN); 141 memcpy(p->designated_root.addr, addr, ETH_ALEN);
141 142
142 } 143 }
@@ -157,12 +158,12 @@ void br_stp_recalculate_bridge_id(struct net_bridge *br)
157 158
158 list_for_each_entry(p, &br->port_list, list) { 159 list_for_each_entry(p, &br->port_list, list) {
159 if (addr == br_mac_zero || 160 if (addr == br_mac_zero ||
160 memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0) 161 compare_ether_addr(p->dev->dev_addr, addr) < 0)
161 addr = p->dev->dev_addr; 162 addr = p->dev->dev_addr;
162 163
163 } 164 }
164 165
165 if (memcmp(br->bridge_id.addr, addr, ETH_ALEN)) 166 if (compare_ether_addr(br->bridge_id.addr, addr))
166 br_stp_change_bridge_id(br, addr); 167 br_stp_change_bridge_id(br, addr);
167} 168}
168 169