summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c b/cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c
index 1a430eccec..d57eba699c 100644
--- a/cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c
+++ b/cleopatre/linux-2.6.25.10-spc300/net/bridge/br_stp_if.c
@@ -216,13 +216,44 @@ void br_stp_recalculate_bridge_id(struct net_bridge *br)
const unsigned char *addr = br_mac_zero;
struct net_bridge_port *p;
+#ifdef CONFIG_ARCH_SPC300
+ /* If plc0 interface exists use its MAC addr for bridge MAC addr */
+ list_for_each_entry(p, &br->port_list, list) {
+ if (strcmp(p->dev->name, "plc0") == 0) {
+ addr = p->dev->dev_addr;
+ break;
+ }
+ }
+
+ /* If plc0 interface doesn't exist try to find some other
+ plc interface and use first found */
+ if (addr == br_mac_zero) {
+ list_for_each_entry(p, &br->port_list, list) {
+ if (strncmp(p->dev->name, "plc", 3) == 0) {
+ addr = p->dev->dev_addr;
+ break;
+ }
+ }
+ }
+
+ /* If PLC interface doesn't exist use interface with minimal MAC address */
+ if (addr == br_mac_zero) {
+ list_for_each_entry(p, &br->port_list, list) {
+ if (addr == br_mac_zero ||
+ memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0) {
+ addr = p->dev->dev_addr;
+ }
+ }
+ }
+#else
+ /* Use interface with minimal MAC address */
list_for_each_entry(p, &br->port_list, list) {
if (addr == br_mac_zero ||
memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0)
addr = p->dev->dev_addr;
}
-
+#endif
if (compare_ether_addr(br->bridge_id.addr, addr))
br_stp_change_bridge_id(br, addr);
}