| 1 |
From stable-bounces@linux.kernel.org Tue Jan 3 15:31:50 2006 |
| 2 |
Date: Tue, 3 Jan 2006 15:28:05 -0800 |
| 3 |
From: Stephen Hemminger <shemminger@osdl.org> |
| 4 |
To: stable@kernel.org |
| 5 |
Message-ID: <20060103152805.39fda518@dxpl.pdx.osdl.net> |
| 6 |
Cc: |
| 7 |
Subject: BRIDGE: Fix faulty check in br_stp_recalculate_bridge_id() |
| 8 |
|
| 9 |
There is a regression in 2.6.15. |
| 10 |
One of the conversions from memcmp to compare_ether_addr is incorrect. |
| 11 |
We need to do relative comparison to determine min MAC address to |
| 12 |
use in bridge id. This will cause the wrong bridge id to be chosen |
| 13 |
which violates 802.1d Spanning Tree Protocol, and may create forwarding |
| 14 |
loops. |
| 15 |
|
| 16 |
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> |
| 17 |
Signed-off-by: Chris Wright <chrisw@sous-sol.org> |
| 18 |
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> |
| 19 |
--- |
| 20 |
|
| 21 |
net/bridge/br_stp_if.c | 2 +- |
| 22 |
1 files changed, 1 insertion(+), 1 deletion(-) |
| 23 |
|
| 24 |
Index: linux-2.6.15.y/net/bridge/br_stp_if.c |
| 25 |
=================================================================== |
| 26 |
--- linux-2.6.15.y.orig/net/bridge/br_stp_if.c |
| 27 |
+++ linux-2.6.15.y/net/bridge/br_stp_if.c |
| 28 |
@@ -158,7 +158,7 @@ void br_stp_recalculate_bridge_id(struct |
| 29 |
|
| 30 |
list_for_each_entry(p, &br->port_list, list) { |
| 31 |
if (addr == br_mac_zero || |
| 32 |
- compare_ether_addr(p->dev->dev_addr, addr) < 0) |
| 33 |
+ memcmp(p->dev->dev_addr, addr, ETH_ALEN) < 0) |
| 34 |
addr = p->dev->dev_addr; |
| 35 |
|
| 36 |
} |