aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-12-16 16:35:51 -0500
committerDavid S. Miller <davem@davemloft.net>2007-12-16 16:35:51 -0500
commit3ae412544cde6d987e0e48778bd87bc96a5749df (patch)
treec0f62a4781edbc00d4da5480a4608784461715fa
parentf33e1d9fa20381afa3be7e7f560c59845bfa5cec (diff)
[BRIDGE]: Assign random address.
Assigning a valid random address to bridge device solves problems when bridge device is brought up before adding real device to bridge. When the first real device is added to the bridge, it's address will overide the bridges random address. Note: any device added to a bridge must already have a valid ethernet address. br_add_if -> br_fdb_insert -> fdb_insert -> is_valid_ether_addr Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bridge/br_device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index c07bac5e3e10..bf7787395fe0 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -157,8 +157,7 @@ static struct ethtool_ops br_ethtool_ops = {
157 157
158void br_dev_setup(struct net_device *dev) 158void br_dev_setup(struct net_device *dev)
159{ 159{
160 memset(dev->dev_addr, 0, ETH_ALEN); 160 random_ether_addr(dev->dev_addr);
161
162 ether_setup(dev); 161 ether_setup(dev);
163 162
164 dev->do_ioctl = br_dev_ioctl; 163 dev->do_ioctl = br_dev_ioctl;