[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Dec 2007 16:02:28 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Stephen Hemminger <shemminger@...ux-foundation.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
bugme-daemon@...zilla.kernel.org, berrange@...hat.com,
jeff@...zik.org, herbert@...dor.apana.org.au, rjw@...k.pl
Subject: Re: [PATCH] bridge: assign random address
On Tue, 11 Dec 2007 15:48:35 -0800
Stephen Hemminger <shemminger@...ux-foundation.org> wrote:
> 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@...ux-foundation.org>
>
> --- a/net/bridge/br_device.c 2007-10-16 16:48:21.000000000 -0700
> +++ b/net/bridge/br_device.c 2007-12-11 15:36:52.000000000 -0800
> @@ -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;
I'd have thought that a comment is needed here as it is rather unobvious
what that code is there for.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists