From: Stephen Hemminger Date: Sun, 16 Dec 2007 21:35:51 +0000 (-0800) Subject: [BRIDGE]: Assign random address. X-Git-Tag: v2.6.24-rc6~67^2~9 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3ae412544cde6d987e0e48778bd87bc96a5749df;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index c07bac5e3e1..bf7787395fe 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c @@ -157,8 +157,7 @@ static struct ethtool_ops br_ethtool_ops = { void br_dev_setup(struct net_device *dev) { - memset(dev->dev_addr, 0, ETH_ALEN); - + random_ether_addr(dev->dev_addr); ether_setup(dev); dev->do_ioctl = br_dev_ioctl;